diff --git a/.swcrc b/.swcrc index 982a3303..49c67980 100644 --- a/.swcrc +++ b/.swcrc @@ -25,7 +25,7 @@ "@/*": ["src/*"] } }, - "exclude": ["examples","src/tests", ".test.ts"], + "exclude": ["examples", "src/tests", ".test.ts"], "minify": false, "sourceMaps": "inline" } diff --git a/packages/lightspark-wallet-sdk/.npmignore b/packages/lightspark-wallet-sdk/.npmignore new file mode 100644 index 00000000..ef7aa8ee --- /dev/null +++ b/packages/lightspark-wallet-sdk/.npmignore @@ -0,0 +1,5 @@ +src/**/*.test.ts +jest.config.js +tsconfig.json +tsconfig.build.json +postbuild.js diff --git a/packages/lightspark-wallet-sdk/README.md b/packages/lightspark-wallet-sdk/README.md new file mode 100644 index 00000000..ead47859 --- /dev/null +++ b/packages/lightspark-wallet-sdk/README.md @@ -0,0 +1,52 @@ +# @distributedlab/tools +These packages aim to provide developers with a set of commonly used functions and features for building web applications, such as handling big numbers, date manipulation, subscribing to and receiving notifications when certain events occur with EventEmitter, and more. + +![version (scoped package)](https://badgen.net/npm/v/@distributedlab/tools) +![types](https://badgen.net/npm/types/@distributedlab/tools) +![tree-shaking](https://badgen.net/bundlephobia/tree-shaking/@distributedlab/tools) +![checks](https://badgen.net/github/checks/distributed-lab/web-kit/main) + +## Getting Started + +### Installing + +``` +yarn add @distributedlab/tools +``` + +#### Work with big numbers +BN uses 26 (yoctoNEAR + 2 (percent precision)) maximum precision by default. +You can change it by `BN.setConfig` method. + +```ts +import { BN } from '@distributedlab/tools'; + +const amountA = BN.fromRaw(2, 18) +const amountB = BN.fromRaw(3, 18) + +console.log(amountA.add(amountB).format({ + decimals: 18, + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, +})) +``` + +#### Work with dates +```ts +import { time } from '@distributedlab/tools'; + +const currentDate = time() + +console.log(currentDate.format('YYYY-MM-DD')) +``` + +## Running the tests + +``` +yarn test +``` + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](../../LICENSE) file for details diff --git a/packages/lightspark-wallet-sdk/helpers/authHelpers.ts b/packages/lightspark-wallet-sdk/helpers/authHelpers.ts new file mode 100644 index 00000000..3dca1800 --- /dev/null +++ b/packages/lightspark-wallet-sdk/helpers/authHelpers.ts @@ -0,0 +1,35 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type EnvCredentials = { + accountId: string + jwt: string + pubKey?: string + privKey?: string + baseUrl: string + jwtSigningPrivateKey?: string +} + +export const getCredentialsFromEnvOrThrow = ( + walletEnvSuffix = ``, +): EnvCredentials => { + const accountId = process.env[`LIGHTSPARK_ACCOUNT_ID`] + const jwtSigningPrivateKey = process.env[`LIGHTSPARK_JWT_PRIV_KEY`] + const jwt = process.env[`LIGHTSPARK_JWT${walletEnvSuffix}`] + const pubKey = process.env[`LIGHTSPARK_WALLET_PUB_KEY${walletEnvSuffix}`] + const privKey = process.env[`LIGHTSPARK_WALLET_PRIV_KEY${walletEnvSuffix}`] + const baseUrl = + process.env[`LIGHTSPARK_EXAMPLE_BASE_URL`] || `api.lightspark.com` + if (!accountId || !jwt) { + throw new Error( + `Missing test credentials. Please set LIGHTSPARK_ACCOUNT_ID and LIGHTSPARK_JWT.`, + ) + } + return { + accountId, + jwt, + pubKey, + privKey, + baseUrl, + jwtSigningPrivateKey, + } +} diff --git a/packages/lightspark-wallet-sdk/jest.config.js b/packages/lightspark-wallet-sdk/jest.config.js new file mode 100644 index 00000000..cb9e24d6 --- /dev/null +++ b/packages/lightspark-wallet-sdk/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('../../jest.config.base.js'), +}; diff --git a/packages/lightspark-wallet-sdk/package.json b/packages/lightspark-wallet-sdk/package.json new file mode 100644 index 00000000..13843e2d --- /dev/null +++ b/packages/lightspark-wallet-sdk/package.json @@ -0,0 +1,68 @@ +{ + "name": "@distributedlab/lightspark-wallet-sdk", + "version": "1.0.0-rc.4", + "description": "Wallet SDK for lightning network by Lightspark", + "repository": { + "type": "git", + "url": "https://github.com/distributed-lab/web-kit.git", + "directory": "packages/tools" + }, + "homepage": "https://distributed-lab.github.io/web-kit/modules/_distributedlab_lightspark_wallet_sdk.html", + "license": "MIT", + "sideEffects": false, + "typesVersions": { + ">=4.2": { + "*": [ + "./dist/types/*" + ] + } + }, + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "browser": "./dist/esm/index.js", + "node": "./dist/cjs/index.js", + "unpkg": "./dist/index.js", + "types": "index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "require": "./dist/cjs/index.js", + "node": "./dist/cjs/index.js", + "import": "./dist/esm/index.js", + "default": "./dist/esm/index.js" + } + }, + "scripts": { + "build": "yarn clean && yarn build:types && yarn build:cjs && yarn build:esm && node ./postbuild.js", + "build:types": "tsc -p tsconfig.build.json --outDir ./dist/types --declaration --emitDeclarationOnly", + "build:cjs": "npx swc src -d ./dist/cjs --config-file ../../.swcrc -C module.type=commonjs", + "build:esm": "npx swc src -d ./dist/esm --config-file ../../.swcrc -C module.type=es6 isModule=true", + "clean": "rm -rf dist", + "test": "yarn jest --verbose", + "typecheck": "tsc --noEmit" + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@swc/cli": "^0.1.62", + "@swc/core": "^1.3.53", + "@swc/jest": "^0.2.26", + "@types/jest": "^29.5.1", + "@types/node": "^18.14.2", + "jest": "^29.5.0", + "tsc-alias": "^1.8.2" + }, + "dependencies": { + "@lightsparkdev/core": "^0.3.9", + "@react-native-async-storage/async-storage": "^1.19.1", + "bignumber.js": "^9.1.1", + "dayjs": "^1.11.7", + "tslib": "^2.5.0" + }, + "typedoc": { + "entryPoint": "./src/index.ts", + "readmeFile": "./README.md", + "displayName": "@distributedlab/tools" + } +} diff --git a/packages/lightspark-wallet-sdk/postbuild.js b/packages/lightspark-wallet-sdk/postbuild.js new file mode 100644 index 00000000..3004bbd9 --- /dev/null +++ b/packages/lightspark-wallet-sdk/postbuild.js @@ -0,0 +1,3 @@ +const postbuild = require('../../scripts/postbuild'); + +postbuild(__dirname) diff --git a/packages/lightspark-wallet-sdk/src/__tests__/general.test.ts b/packages/lightspark-wallet-sdk/src/__tests__/general.test.ts new file mode 100644 index 00000000..573f2a03 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/__tests__/general.test.ts @@ -0,0 +1,136 @@ +import { describe, expect, test } from '@jest/globals' + +// import { DefaultCrypto } from '@lightsparkdev/core' +import { LightsparkClient } from '@/client' +import { + type InvoiceData, + // KeyType, + TransactionStatus, + WalletStatus, + WithdrawalRequestStatus, +} from '@/objects' + +import { getCredentialsFromEnvOrThrow } from '../../helpers/authHelpers' + +describe('Sanity tests', () => { + getCredentialsFromEnvOrThrow('_testUser1') + + // Let's start by creating a client + const client = new LightsparkClient() + + console.log(client) + + test('should deploy the wallet', async () => { + const walletStatus: WalletStatus = + await client.deployWalletAndAwaitDeployed() + + expect(walletStatus).toBe(WalletStatus.DEPLOYED) + }) + + test('should init the wallet', async () => { + // const keyPair = await DefaultCrypto.generateSigningKeyPair() + // const signingWalletPublicKey = keyPair.publicKey + // const signingWalletPrivateKey = keyPair.privateKey + + // const walletStatus = await client.initializeWalletAndAwaitReady( + // KeyType.RSA_OAEP, + // signingWalletPublicKey as string, + // { + // key: signingWalletPrivateKey as string, + // }, + // ) + + // expect(walletStatus).toBe(WalletStatus.READY) + + expect(1).toBe(1) + }) + + let invoiceData: InvoiceData | null + + test('should create an invoice', async () => { + const _invoiceData = await client.createInvoice(100_000, 'mmmmm pizza') + + invoiceData = _invoiceData as InvoiceData | null + + expect(invoiceData).not.toBe(null) + }) + + test('should pay an invoice', async () => { + if (!invoiceData?.encodedPaymentRequest) + throw new Error('invoiceData is null') + + const payment = await client.payInvoice( + invoiceData.encodedPaymentRequest, + 50_000, + ) + + expect(payment.status).toBe(TransactionStatus.SUCCESS) + + expect(1).toBe(1) + }) + + test('should deposit', async () => { + expect(1).toBe(1) + }) + + test('should withdraw', async () => { + const withdrawalRequest = await client.requestWithdrawal( + 50_000, + 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq', + ) + + expect(withdrawalRequest?.status).toBe(WithdrawalRequestStatus.SUCCESSFUL) + }) +}) + +describe('P1 tests', () => { + test('should generate a key', async () => { + expect(1).toBe(1) + }) + + test('should fetch the current wallet', async () => { + expect(1).toBe(1) + }) + + test('should list current payment requests', async () => { + expect(1).toBe(1) + }) + + test('should list recent transactions', async () => { + expect(1).toBe(1) + }) + + test('should fetch an entity by ID', async () => { + expect(1).toBe(1) + }) + + test('should terminate a wallet', async () => { + expect(1).toBe(1) + }) + + test('should decode an invoice', async () => { + expect(1).toBe(1) + }) +}) + +describe('P2 tests', () => { + test('should get bitcoin fee estimates', async () => { + expect(1).toBe(1) + }) + + test('should send a keysend payment', async () => { + expect(1).toBe(1) + }) + + test('should create a test mode invoice', async () => { + expect(1).toBe(1) + }) + + test('should create a test mode payment', async () => { + expect(1).toBe(1) + }) + + test('should execute a raw graphql query', async () => { + expect(1).toBe(1) + }) +}) diff --git a/packages/lightspark-wallet-sdk/src/auth/index.ts b/packages/lightspark-wallet-sdk/src/auth/index.ts new file mode 100644 index 00000000..6700c430 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/index.ts @@ -0,0 +1 @@ +export * from './jwt' diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/CustomJwtAuthProvider.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/CustomJwtAuthProvider.ts new file mode 100644 index 00000000..61c8849a --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/CustomJwtAuthProvider.ts @@ -0,0 +1,53 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type AuthProvider } from '@lightsparkdev/core' + +import type { JwtStorage, JwtTokenInfo } from '@/auth' + +/** + * A custom [AuthProvider] that uses a JWT token to authenticate requests. + * + * Should generally not be used directly by clients, but rather through the [loginWithJwt] method of a + * [LightsparkWalletClient]. + * + * @param tokenStorage A [JwtStorage] implementation that stores or retrieves the current JWT token info. + */ +export class CustomJwtAuthProvider implements AuthProvider { + constructor(private jwtStorage: JwtStorage) {} + + public async setTokenInfo(tokenInfo: JwtTokenInfo): Promise { + await this.jwtStorage.replace(tokenInfo) + } + + public async logout(): Promise { + await this.jwtStorage.clear() + } + + public async addAuthHeaders(headers: any): Promise { + const tokenInfo = await this.jwtStorage.getCurrent() + if (!tokenInfo) { + return headers + } + return Object.assign({}, headers, { + authorization: `Bearer ${tokenInfo.accessToken}`, + }) + } + + public async isAuthorized(): Promise { + const tokenInfo = await this.jwtStorage.getCurrent() + if (!tokenInfo) { + return false + } + return tokenInfo.validUntil > new Date() + } + + public async addWsConnectionParams(params: any) { + const tokenInfo = await this.jwtStorage.getCurrent() + if (!tokenInfo) { + return params + } + return Object.assign({}, params, { + access_token: tokenInfo.accessToken, + }) + } +} diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/InMemoryJwtStorage.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/InMemoryJwtStorage.ts new file mode 100644 index 00000000..85139a67 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/InMemoryJwtStorage.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { JwtStorage, JwtTokenInfo } from '@/auth' + +/** + * In-memory implementation of {@link JwtStorage}. + */ +export class InMemoryJwtStorage implements JwtStorage { + private tokenInfo: JwtTokenInfo | null = null + + async getCurrent(): Promise { + return this.tokenInfo + } + + async replace(tokenInfo: JwtTokenInfo): Promise { + this.tokenInfo = tokenInfo + } + + async clear(): Promise { + this.tokenInfo = null + } +} diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/JwtStorage.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/JwtStorage.ts new file mode 100644 index 00000000..0398be4d --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/JwtStorage.ts @@ -0,0 +1,12 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type JwtTokenInfo } from '@/auth' + +/** + * Interface for storing and retrieving JWT token info. + */ +export interface JwtStorage { + getCurrent(): Promise + replace(tokenInfo: JwtTokenInfo): Promise + clear(): Promise +} diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/JwtTokenInfo.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/JwtTokenInfo.ts new file mode 100644 index 00000000..e3cc4dc3 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/JwtTokenInfo.ts @@ -0,0 +1,6 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type JwtTokenInfo = { + accessToken: string + validUntil: Date +} diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/LocalStorageJwtStorage.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/LocalStorageJwtStorage.ts new file mode 100644 index 00000000..945b1a76 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/LocalStorageJwtStorage.ts @@ -0,0 +1,41 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import AsyncStorage from '@react-native-async-storage/async-storage' + +import { type JwtStorage, type JwtTokenInfo } from '@/auth' + +const STORAGE_KEY = 'lightspark-jwt' + +/** + * Stores JWT token info in local storage or the appropriate equivalent for react native. + * See here for more platform-specific storage location: + * https://react-native-async-storage.github.io/async-storage/docs/advanced/where_data_stored + */ +export class LocalStorageJwtStorage implements JwtStorage { + async getCurrent(): Promise { + const tokenInfo = await (AsyncStorage as any).getItem(STORAGE_KEY) + if (tokenInfo === null) { + return null + } + + const parsed = JSON.parse(tokenInfo) + return { + accessToken: parsed.accessToken, + validUntil: new Date(parsed.validUntil), + } + } + + async replace(tokenInfo: JwtTokenInfo): Promise { + await (AsyncStorage as any).setItem( + STORAGE_KEY, + JSON.stringify({ + accessToken: tokenInfo.accessToken, + validUntil: tokenInfo.validUntil.toISOString(), + }), + ) + } + + async clear(): Promise { + await (AsyncStorage as any).removeItem(STORAGE_KEY) + } +} diff --git a/packages/lightspark-wallet-sdk/src/auth/jwt/index.ts b/packages/lightspark-wallet-sdk/src/auth/jwt/index.ts new file mode 100644 index 00000000..04588895 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/auth/jwt/index.ts @@ -0,0 +1,5 @@ +export * from './CustomJwtAuthProvider' +export * from './InMemoryJwtStorage' +export * from './JwtStorage' +export * from './JwtTokenInfo' +export * from './LocalStorageJwtStorage' diff --git a/packages/lightspark-wallet-sdk/src/client.ts b/packages/lightspark-wallet-sdk/src/client.ts new file mode 100644 index 00000000..fe2d4a31 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/client.ts @@ -0,0 +1,954 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { + type AuthProvider, + type CryptoInterface, + DefaultCrypto, + type KeyOrAliasType, + LightsparkAuthException, + LightsparkException, + NodeKeyCache, + type Query, + Requester, + StubAuthProvider, +} from '@lightsparkdev/core' +import autoBind from 'auto-bind' +import { Observable, type Subscription } from 'zen-observable-ts' + +import { CustomJwtAuthProvider, type JwtStorage } from '@/auth' +import { + BitcoinFeeEstimateQuery, + CreateBitcoinFundingAddress, + CreateInvoiceMutation, + CreateTestModeInvoice, + CreateTestModePayment, + CurrentWalletQuery, + DecodeInvoiceQuery, + DeployWallet, + InitializeWallet, + LightningFeeEstimateForInvoiceQuery, + LightningFeeEstimateForNodeQuery, + LoginWithJWT, + PayInvoiceMutation, + RequestWithdrawalMutation, + SendPaymentMutation, + TerminateWallet, + WalletDashboardQuery, +} from '@/graqhql' +import { + BalancesFromJson, + type CurrencyAmount, + CurrencyAmountFromJson, + DeployWalletOutputFromJson, + type FeeEstimate, + FeeEstimateFromJson, + InitializeWalletOutputFromJson, + InvoiceDataFromJson, + InvoiceType, + type KeyType, + LoginWithJWTOutputFromJson, + type OutgoingPayment, + OutgoingPaymentFragment, + OutgoingPaymentFromJson, + TerminateWalletOutputFromJson, + TransactionStatus, + type WalletDashboard, + WalletFromJson, + WalletStatus, + WalletToPaymentRequestsConnectionFromJson, + WalletToTransactionsConnectionFromJson, + type WithdrawalRequest, + WithdrawalRequestFromJson, +} from '@/objects' + +import packageJson from '../package.json' + +const sdkVersion = packageJson.version + +/** + * The LightsparkClient is the main entrypoint for interacting with the Lightspark Wallet SDK. + * + * ```ts + * const lightsparkClient = new LightsparkClient( + * new CustomJwtAuthProvider(new LocalStorageJwtStorage()), + * ); + * const encodedInvoice = await lightsparkClient.createInvoice( + * { value: 100, unit: CurrencyUnit.SATOSHI }, + * "Whasssupppp", + * InvoiceType.AMP, + * ); + * + * const invoiceDetails = await lightsparkClient.decodeInvoice(encodedInvoice); + * console.log(invoiceDetails); + * + * const payment = await lightsparkClient.payInvoice(encodedInvoice, 1_000_000); + * console.log(payment); + * ``` + * + * @class LightsparkClient + */ +export class LightsparkClient { + private requester: Requester + private readonly nodeKeyCache: NodeKeyCache + + /** + * Constructs a new LightsparkClient. + * + * @param authProvider The auth provider to use for authentication. Defaults to a stub auth provider. For server-side + * 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`. + */ + constructor( + private authProvider: AuthProvider = new StubAuthProvider(), + private readonly serverUrl: string = 'api.lightspark.com', + private readonly cryptoImpl: CryptoInterface = DefaultCrypto, + ) { + this.nodeKeyCache = new NodeKeyCache(this.cryptoImpl) + this.requester = new Requester( + this.nodeKeyCache, + WALLET_SDK_ENDPOINT, + `js-wallet-sdk/${sdkVersion}`, + authProvider, + serverUrl, + this.cryptoImpl, + ) + + autoBind(this) + } + + /** + * 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 + */ + public async setAuthProvider(authProvider: AuthProvider) { + this.requester = new Requester( + this.nodeKeyCache, + WALLET_SDK_ENDPOINT, + `js-wallet-sdk/${sdkVersion}`, + authProvider, + this.serverUrl, + this.cryptoImpl, + ) + this.authProvider = authProvider + } + + /** + * @returns Whether or not the client is authorized. This is useful for determining if the user is logged in or not. + */ + public async isAuthorized(): Promise { + return this.authProvider.isAuthorized() + } + + /** + * Login using the Custom JWT authentication scheme described in our documentation. + * + * Note: When using this method, you are responsible for refreshing the JWT token before or when it expires. If the + * token expires, the client will throw a [LightsparkAuthenticationException] on the next API call which requires + * valid authentication. Then you'll need to call this method again to get a new token. + * + * @param accountId The account ID to login with. This is specific to your company's account. + * @param jwt The JWT to use for authentication of this user. + * @param storage The storage to use for storing the JWT token. + * @return The output of the login operation, including the access token, expiration time, and wallet info. + */ + public async loginWithJWT( + accountId: string, + jwt: string, + storage: JwtStorage, + ) { + const response = await this.executeRawQuery({ + queryPayload: LoginWithJWT, + variables: { + account_id: accountId, + jwt, + }, + constructObject: (responseJson: any) => { + return LoginWithJWTOutputFromJson(responseJson.login_with_jwt) + }, + skipAuth: true, + }) + + if (!response) { + throw new LightsparkAuthException( + 'Login failed. Please check your credentials and try again.', + ) + } + + const authProvider = new CustomJwtAuthProvider(storage) + await authProvider.setTokenInfo({ + accessToken: response.accessToken, + validUntil: new Date(response.validUntil), + }) + await this.setAuthProvider(authProvider) + + return response + } + + /** + * Deploys a wallet in the Lightspark infrastructure. This is an asynchronous operation, the caller should then poll + * the wallet frequently (or subscribe to its modifications). When this process is over, the Wallet status will + * change to `DEPLOYED` (or `FAILED`). + * + * @return The wallet that was deployed. + */ + public async deployWallet() { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: DeployWallet, + constructObject: (responseJson: any) => { + return DeployWalletOutputFromJson(responseJson.deploy_wallet).wallet + }, + }) + } + + /** + * Deploys a wallet in the Lightspark infrastructure and waits for it to be deployed. + * This is an asynchronous operation, which will continue processing wallet status updates until + * the Wallet status changes to `DEPLOYED` (or `FAILED`). + * + * @return A Promise with the final wallet status after deployment or failure. + * @throws LightsparkException if the wallet status is not `DEPLOYED` or `FAILED` after 60 seconds, + * or if the subscription fails. + */ + public async deployWalletAndAwaitDeployed() { + const wallet = await this.deployWallet() + if ( + wallet?.status === WalletStatus.DEPLOYED || + wallet?.status === WalletStatus.FAILED + ) { + return wallet.status + } + return await this.waitForWalletStatus([ + WalletStatus.DEPLOYED, + WalletStatus.FAILED, + ]) + } + + /** + * Initializes a wallet in the Lightspark infrastructure and syncs it to the Bitcoin network. This is an + * asynchronous operation, the caller should then poll the wallet frequently (or subscribe to its modifications). + * When this process is over, the Wallet status will change to `READY` (or `FAILED`). + * + * @param keyType The type of key to use for the wallet. + * @param signingPublicKey The base64-encoded public key to use for signing transactions. + * @param signingPrivateKeyOrAlias An object containing either the base64-encoded private key or, in the case of + * React Native, a key alias for a key in the mobile keystore. The key will be used for signing transactions. This + * key will not leave the device. It is only used for signing transactions locally. + * @return The wallet that was initialized. + */ + public async initializeWallet( + keyType: KeyType, + signingPublicKey: string, + signingPrivateKeyOrAlias: KeyOrAliasType, + ) { + this.requireValidAuth() + await this.loadWalletSigningKey(signingPrivateKeyOrAlias) + return await this.executeRawQuery({ + queryPayload: InitializeWallet, + variables: { + key_type: keyType, + signing_public_key: signingPublicKey, + }, + signingNodeId: WALLET_NODE_ID_KEY, + constructObject: (responseJson: any) => { + return InitializeWalletOutputFromJson(responseJson.initialize_wallet) + .wallet + }, + }) + } + + /** + * Initializes a wallet in the Lightspark infrastructure and syncs it to the Bitcoin network. + * This is an asynchronous operation, which will continue processing wallet status updates until + * the Wallet status changes to `READY` (or `FAILED`). + * + * @param keyType The type of key to use for the wallet. + * @param signingPublicKey The base64-encoded public key to use for signing transactions. + * @param signingPrivateKeyOrAlias An object containing either the base64-encoded private key or, in the case of + * React Native, a key alias for a key in the mobile keystore. The key will be used for signing transactions. This + * key will not leave the device. It is only used for signing transactions locally. + * @return A Promise with the final wallet status after initialization or failure. + * @throws LightsparkException if the wallet status is not `READY` or `FAILED` after 5 minutes, + * or if the subscription fails. + */ + public async initializeWalletAndAwaitReady( + keyType: KeyType, + signingPublicKey: string, + signingPrivateKeyOrAlias: KeyOrAliasType, + ) { + const wallet = await this.initializeWallet( + keyType, + signingPublicKey, + signingPrivateKeyOrAlias, + ) + if ( + wallet?.status === WalletStatus.READY || + wallet?.status === WalletStatus.FAILED + ) { + return wallet.status + } + return await this.waitForWalletStatus( + [WalletStatus.READY, WalletStatus.FAILED], + 300, + ) + } + + /** + * Removes the wallet from Lightspark infrastructure. It won't be connected to the Lightning network anymore and + * its funds won't be accessible outside of the Funds Recovery Kit process. + * + * @return The wallet that was terminated. + */ + public async terminateWallet() { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: TerminateWallet, + constructObject: (responseJson: any) => { + return TerminateWalletOutputFromJson(responseJson.terminate_wallet) + .wallet + }, + }) + } + + /** + * Get the dashboard overview for a Lightning wallet. Includes balance info and + * the most recent transactions and payment requests. + * + * @param numTransactions The max number of recent transactions to fetch. Defaults to 20. + * @param numPaymentRequests The max number of recent payment requests to fetch. Defaults to 20. + * @return The dashboard overview for the wallet, including balance and recent transactions and payment requests. + */ + public async getWalletDashboard( + numTransactions = 20, + numPaymentRequests = 20, + ) { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: WalletDashboardQuery, + variables: { + numTransactions, + numPaymentRequests, + }, + constructObject: (responseJson: any): WalletDashboard | null => { + const currentWallet = responseJson.current_wallet + if (!currentWallet) { + return null + } + return { + id: currentWallet.id, + status: currentWallet.status as WalletStatus, + balances: + currentWallet.balances && BalancesFromJson(currentWallet.balances), + recentTransactions: + currentWallet.recent_transactions && + WalletToTransactionsConnectionFromJson( + currentWallet.recent_transactions, + ), + paymentRequests: + currentWallet.payment_requests && + WalletToPaymentRequestsConnectionFromJson( + currentWallet.payment_requests, + ), + } + }, + }) + } + + /** + * Creates a lightning invoice from the current wallet. + * + * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment]. + * + * @param amountMsats The amount of the invoice in milli-satoshis. + * @param memo Optional memo to include in the invoice. + * @param type The type of invoice to create. Defaults to [InvoiceType.STANDARD]. + * @return The created invoice. + */ + public async createInvoice( + amountMsats: number, + memo: string | undefined = undefined, + type: InvoiceType = InvoiceType.STANDARD, + ) { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: CreateInvoiceMutation, + variables: { + amountMsats, + memo, + type, + }, + constructObject: (responseJson: any) => { + return InvoiceDataFromJson(responseJson.create_invoice.invoice.data) + }, + }) + } + + /** + * Pay a lightning invoice from the current wallet. This function will return immediately with the payment details, + * which may still be in a PENDING state. You can use the [payInvoiceAndAwaitResult] function to wait for the payment + * to complete or fail. + * + * Note: This call will fail if the wallet is not unlocked yet via [loadWalletSigningKey]. You must successfully + * unlock the wallet before calling this function. + * + * Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can + * pay in test mode. + * + * @param encodedInvoice An encoded string representation of the invoice to pay. + * @param maxFeesMsats The maximum fees to pay in milli-satoshis. You must pass a value. + * 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. + * @param amountMsats The amount to pay in milli-satoshis. Defaults to the full amount of the invoice. + * @param timeoutSecs The number of seconds to wait for the payment to complete. Defaults to 60. + * @return The payment details, which may still be in a PENDING state. You can use the [payInvoiceAndAwaitResult] + * function to wait for the payment to complete or fail. + */ + public async payInvoice( + encodedInvoice: string, + maxFeesMsats: number, + amountMsats: number | undefined = undefined, + timoutSecs = 60, + ) { + this.requireValidAuth() + this.requireWalletUnlocked() + const variables: any = { + encoded_invoice: encodedInvoice, + maximum_fees_msats: maxFeesMsats, + timeout_secs: timoutSecs, + } + if (amountMsats !== undefined) { + variables.amount_msats = amountMsats + } + const payment = await this.executeRawQuery({ + queryPayload: PayInvoiceMutation, + variables, + constructObject: (responseJson: any) => { + return OutgoingPaymentFromJson(responseJson.pay_invoice.payment) + }, + signingNodeId: WALLET_NODE_ID_KEY, + }) + if (!payment) { + throw new LightsparkException( + 'PaymentNullError', + 'Unknown error paying invoice', + ) + } + return payment + } + + /** + * Pay a lightning invoice from the current wallet and wait for the payment to complete or fail. + * + * Note: This call will fail if the wallet is not unlocked yet via [loadWalletSigningKey]. You must successfully + * unlock the wallet before calling this function. + * + * @param encodedInvoice An encoded string representation of the invoice to pay. + * @param maxFeesMsats The maximum fees to pay in milli-satoshis. You must pass a value. + * 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. + * @param amountMsats The amount to pay in milli-satoshis. Defaults to the full amount of the invoice. + * @param timeoutSecs The number of seconds to wait for the payment to complete. Defaults to 60. + * @return The payment details. + */ + public async payInvoiceAndAwaitResult( + encodedInvoice: string, + maxFeesMsats: number, + amountMsats: number | undefined = undefined, + timoutSecs = 60, + ) { + const payment = await this.payInvoice( + encodedInvoice, + maxFeesMsats, + amountMsats, + timoutSecs, + ) + return await this.awaitPaymentResult(payment, timoutSecs) + } + + private awaitPaymentResult( + payment: OutgoingPayment, + timeoutSecs = 60, + ): Promise { + let timeout: NodeJS.Timeout + let subscription: Subscription + const completionStatuses = [ + TransactionStatus.FAILED, + TransactionStatus.CANCELLED, + TransactionStatus.SUCCESS, + ] + if (completionStatuses.includes(payment.status)) { + return Promise.resolve(payment) + } + const result: Promise = new Promise((resolve, reject) => { + subscription = this.listenToPaymentStatus(payment.id).subscribe({ + next: payment => { + if (completionStatuses.includes(payment.status)) { + resolve(payment) + } + }, + error: error => { + reject(error) + }, + complete: () => { + reject( + new LightsparkException( + 'PaymentStatusAwaitError', + 'Payment status subscription completed without receiving a completed status update.', + ), + ) + }, + }) + + timeout = setTimeout(() => { + reject( + new LightsparkException( + 'PaymentStatusAwaitError', + `Timed out waiting for payment status to be one of ${completionStatuses.join( + ', ', + )}.`, + ), + ) + }, timeoutSecs * 1000) + }) + + result.finally(() => { + clearTimeout(timeout) + subscription.unsubscribe() + }) + + return result + } + + /** + * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice. + * This function will return immediately with the payment details, which may still be in a PENDING state. You can use + * the [sendPaymentAndAwaitResult] function to wait for the payment to complete or fail. + * + * @param destinationPublicKey The public key of the destination node. + * @param amountMsats The amount to pay in milli-satoshis. + * @param maxFeesMsats The maximum amount of fees that you want to pay for this payment to be sent. + * 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. + * @param timeoutSecs The timeout in seconds that we will try to make the payment. + * @return An `OutgoingPayment` object, which may still be in a PENDING state. You can use the + * [sendPaymentAndAwaitResult] function to wait for the payment to complete or fail. + */ + public async sendPayment( + destinationNodePublicKey: string, + amountMsats: number, + maxFeesMsats: number, + timeoutSecs = 60, + ) { + this.requireValidAuth() + this.requireWalletUnlocked() + const payment = await this.executeRawQuery({ + queryPayload: SendPaymentMutation, + variables: { + destination_node_public_key: destinationNodePublicKey, + amount_msats: amountMsats, + maximum_fees_msats: maxFeesMsats, + timeout_secs: timeoutSecs, + }, + constructObject: (responseJson: any) => { + return OutgoingPaymentFromJson(responseJson.send_payment.payment) + }, + signingNodeId: WALLET_NODE_ID_KEY, + }) + if (!payment) { + throw new LightsparkException( + 'PaymentNullError', + 'Unknown error sending payment', + ) + } + return payment + } + + /** + * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice. + * Waits for the payment to complete or fail. + * + * @param destinationPublicKey The public key of the destination node. + * @param amountMsats The amount to pay in milli-satoshis. + * @param maxFeesMsats The maximum amount of fees that you want to pay for this payment to be sent. + * 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. + * @param timeoutSecs The timeout in seconds that we will try to make the payment. + * @return An `OutgoingPayment` object. Check the `status` field to see if the payment succeeded or failed. + */ + public async sendPaymentAndAwaitResult( + destinationNodePublicKey: string, + amountMsats: number, + maxFeesMsats: number, + timeoutSecs = 60, + ) { + const payment = await this.sendPayment( + destinationNodePublicKey, + amountMsats, + maxFeesMsats, + timeoutSecs, + ) + return await this.awaitPaymentResult(payment, timeoutSecs) + } + + /** + * Decode a lightning invoice to get its details included payment amount, destination, etc. + * + * @param encodedInvoice An encoded string representation of the invoice to decode. + * @return The decoded invoice details. + */ + public async decodeInvoice(encodedInvoice: string) { + return await this.executeRawQuery({ + queryPayload: DecodeInvoiceQuery, + variables: { + encoded_payment_request: encodedInvoice, + }, + constructObject: (responseJson: any) => { + return InvoiceDataFromJson(responseJson.decoded_payment_request) + }, + }) + } + + /** + * 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. + */ + public async getBitcoinFeeEstimate(): Promise { + const response = await this.requester.makeRawRequest( + BitcoinFeeEstimateQuery, + ) + return FeeEstimateFromJson(response.bitcoin_fee_estimate) + } + + /** + * Gets an estimate of the fees that will be paid for a Lightning invoice. + * + * @param encodedPaymentRequest The invoice you want to pay (as defined by the BOLT11 standard). + * @param amountMsats If the invoice does not specify a payment amount, then the amount that you wish to pay, + * expressed in msats. + * @returns An estimate of the fees that will be paid for a Lightning invoice. + */ + public async getLightningFeeEstimateForInvoice( + encodedPaymentRequest: string, + amountMsats: number | undefined = undefined, + ): Promise { + this.requireValidAuth() + const response = await this.requester.makeRawRequest( + LightningFeeEstimateForInvoiceQuery, + { + encoded_payment_request: encodedPaymentRequest, + amount_msats: amountMsats, + }, + ) + return CurrencyAmountFromJson( + response.lightning_fee_estimate_for_invoice.fee_estimate, + ) + } + + /** + * Returns an estimate of the fees that will be paid to send a payment to another Lightning node. + * + * @param destinationNodePublicKey The public key of the node that you want to pay. + * @param amountMsats The payment amount expressed in msats. + * @returns An estimate of the fees that will be paid to send a payment to another Lightning node. + */ + public async getLightningFeeEstimateForNode( + destinationNodePublicKey: string, + amountMsats: number, + ): Promise { + this.requireValidAuth() + const response = await this.requester.makeRawRequest( + LightningFeeEstimateForNodeQuery, + { + destination_node_public_key: destinationNodePublicKey, + amount_msats: amountMsats, + }, + ) + return CurrencyAmountFromJson( + response.lightning_fee_estimate_for_node.fee_estimate, + ) + } + + /** + * Unlocks the wallet for use with the SDK for the current application session. This function + * must be called before any other functions that require wallet signing keys, including [payInvoice]. + * + * This function is intended for use in cases where the wallet's private signing key is already saved by the + * application outside of the SDK. It is the responsibility of the application to ensure that the key is valid and + * that it is the correct key for the wallet. Otherwise signed requests will fail. + * + * @param sigingKeyBytesOrAlias An object holding either the PEM encoded bytes of the wallet's private signing key or, + * in the case of ReactNative, the alias of the key in the mobile keychain. + */ + public loadWalletSigningKey(sigingKeyBytesOrAlias: KeyOrAliasType) { + return this.nodeKeyCache.loadKey(WALLET_NODE_ID_KEY, sigingKeyBytesOrAlias) + } + + /** + * Creates an L1 Bitcoin wallet address which can be used to deposit or withdraw funds from the Lightning wallet. + * + * @return The newly created L1 wallet address. + */ + public async createBitcoinFundingAddress() { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: CreateBitcoinFundingAddress, + constructObject: (responseJson: any) => { + return responseJson.create_bitcoin_funding_address + .bitcoin_address as string + }, + }) + } + + /** + * @return The current wallet if one exists, null otherwise. + */ + public async getCurrentWallet() { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: CurrentWalletQuery, + constructObject: (responseJson: any) => { + return WalletFromJson(responseJson.current_wallet) + }, + }) + } + + /** + * Withdraws funds from the account and sends it to the requested bitcoin address. + * + * 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 amountSats The amount of funds to withdraw in SATOSHI. + * @param bitcoinAddress The Bitcoin address to withdraw funds to. + */ + public async requestWithdrawal( + amountSats: number, + bitcoinAddress: string, + ): Promise { + this.requireValidAuth() + this.requireWalletUnlocked() + return await this.executeRawQuery({ + queryPayload: RequestWithdrawalMutation, + variables: { + amount_sats: amountSats, + bitcoin_address: bitcoinAddress, + }, + constructObject: (responseJson: any) => { + return WithdrawalRequestFromJson( + responseJson.request_withdrawal.request, + ) + }, + signingNodeId: WALLET_NODE_ID_KEY, + }) + } + + /** + * 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 amountMsats The amount to pay in milli-satoshis. + * @param memo An optional memo to attach to the invoice. + * @param invoiceType The type of invoice to create. + */ + public async createTestModeInvoice( + amountMsats: number, + memo: string | undefined = undefined, + invoiceType: InvoiceType = InvoiceType.STANDARD, + ): Promise { + this.requireValidAuth() + return await this.executeRawQuery({ + queryPayload: CreateTestModeInvoice, + variables: { + amount_msats: amountMsats, + memo, + invoice_type: invoiceType, + }, + constructObject: (responseJson: any) => { + const encodedPaymentRequest = + responseJson.create_test_mode_invoice?.encoded_payment_request + if (!encodedPaymentRequest) { + throw new LightsparkException( + 'CreateTestModeInvoiceError', + 'Unable to create test mode invoice', + ) + } + return encodedPaymentRequest as string + }, + }) + } + + /** + * 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 encodedInvoice The encoded invoice to pay. + * @param amountMsats The amount to pay in milli-satoshis for 0-amount invoices. This should be null for non-zero + * amount invoices. + */ + public async createTestModePayment( + encodedInvoice: string, + amountMsats: number | undefined = undefined, + ): Promise { + this.requireValidAuth() + this.requireWalletUnlocked() + return await this.executeRawQuery({ + queryPayload: CreateTestModePayment, + variables: { + encoded_invoice: encodedInvoice, + amount_msats: amountMsats, + }, + constructObject: (responseJson: any) => { + return OutgoingPaymentFromJson( + responseJson.create_test_mode_payment?.payment, + ) + }, + signingNodeId: WALLET_NODE_ID_KEY, + }) + } + + /** + * @return True if the wallet is unlocked or false if it is locked. + */ + public isWalletUnlocked() { + return this.nodeKeyCache.hasKey(WALLET_NODE_ID_KEY) + } + + private async requireValidAuth() { + if (!(await this.isAuthorized())) { + throw new LightsparkAuthException( + 'You must be logged in to perform this action.', + ) + } + } + + private requireWalletUnlocked() { + if (!this.isWalletUnlocked()) { + throw new LightsparkAuthException( + 'You must unlock the wallet before performing this action.', + ) + } + } + + private waitForWalletStatus( + statuses: WalletStatus[], + timeoutSecs = 60, + ): Promise { + let timeout: NodeJS.Timeout + let subscription: Subscription + const result: Promise = new Promise((resolve, reject) => { + subscription = this.listenToWalletStatus().subscribe({ + next: status => { + if (statuses.includes(status)) { + resolve(status) + } + }, + error: error => { + reject(error) + }, + complete: () => { + reject( + new LightsparkException( + 'WalletStatusAwaitError', + 'Wallet status subscription completed without receiving a status update.', + ), + ) + }, + }) + + timeout = setTimeout(() => { + reject( + new LightsparkException( + 'WalletStatusAwaitError', + `Timed out waiting for wallet status to be one of ${statuses.join( + ', ', + )}.`, + ), + ) + }, timeoutSecs * 1000) + }) + + result.finally(() => { + clearTimeout(timeout) + subscription.unsubscribe() + }) + + return result + } + + private listenToWalletStatus(): Observable { + return this.requester + .subscribe( + ` + subscription WalletStatusSubscription { + current_wallet { + status + } + }`, + ) + .map((responseJson: any) => { + return ( + WalletStatus[ + responseJson.data.current_wallet.status as unknown as WalletStatus + ] ?? WalletStatus.FUTURE_VALUE + ) + }) + } + + private listenToPaymentStatus( + paymentId: string, + ): Observable { + return this.requester + .subscribe( + ` + subscription PaymentStatusSubscription { + entity(id: "${paymentId}") { + ...OutgoingPaymentFragment + } + } + ${OutgoingPaymentFragment} + `, + ) + .map((responseJson: any) => { + return OutgoingPaymentFromJson(responseJson.data.entity) + }) + } + + /** + * Executes a raw `Query` as a subscription and returns an `Observable` that emits the result of the query when it + * changes. + * + * This can only be used with `subscription` operations. + * + * @param query The `Query` to execute. + * @returns A zen-observable that emits the result of the query when it changes. + */ + public subscribeToRawQuery(query: Query): Observable { + return this.requester + .subscribe(query.queryPayload, query.variables) + .map((responseJson: any) => { + return query.constructObject(responseJson.data) + }) + } + + /** + * 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 + * complex fields from objects. + * + * @param query The `Query` to execute. + * @returns The result of the query. + */ + public executeRawQuery(query: Query): Promise { + return this.requester.executeQuery(query) + } +} + +const WALLET_NODE_ID_KEY = 'wallet_node_id' +const WALLET_SDK_ENDPOINT = 'graphql/wallet/2023-05-05' diff --git a/packages/lightspark-wallet-sdk/src/graqhql/BitcoinFeeEstimate.ts b/packages/lightspark-wallet-sdk/src/graqhql/BitcoinFeeEstimate.ts new file mode 100644 index 00000000..451cd769 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/BitcoinFeeEstimate.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { FeeEstimateFragment } from '@/objects' + +export const BitcoinFeeEstimateQuery = ` + query BitcoinFeeEstimate { + bitcoin_fee_estimate { + ...FeeEstimateFragment + } + } + + ${FeeEstimateFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/CreateBitcoinFundingAddress.ts b/packages/lightspark-wallet-sdk/src/graqhql/CreateBitcoinFundingAddress.ts new file mode 100644 index 00000000..bff6eccd --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/CreateBitcoinFundingAddress.ts @@ -0,0 +1,9 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export const CreateBitcoinFundingAddress = ` + mutation CreateBitcoinFundingAddress { + create_bitcoin_funding_address { + bitcoin_address + } + } +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/CreateInvoice.ts b/packages/lightspark-wallet-sdk/src/graqhql/CreateInvoice.ts new file mode 100644 index 00000000..f204c355 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/CreateInvoice.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { InvoiceDataFragment } from '@/objects' + +export const CreateInvoiceMutation = ` + mutation CreateInvoice( + $amountMsats: Long! + $memo: String + $type: InvoiceType = null + ) { + create_invoice(input: { amount_msats: $amountMsats, memo: $memo, invoice_type: $type }) { + invoice { + data { + ...InvoiceDataFragment + } + } + } + } + + ${InvoiceDataFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModeInvoice.ts b/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModeInvoice.ts new file mode 100644 index 00000000..202b363e --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModeInvoice.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export const CreateTestModeInvoice = ` +mutation CreateTestModeInvoice( + $amount_msats: Long! + $memo: String + $invoice_type: InvoiceType +) { + create_test_mode_invoice(input: { + amount_msats: $amount_msats + memo: $memo + invoice_type: $invoice_type + }) { + encoded_payment_request + } +} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModePayment.ts b/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModePayment.ts new file mode 100644 index 00000000..45550b49 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/CreateTestModePayment.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { OutgoingPaymentFragment } from '@/objects' + +export const CreateTestModePayment = ` +mutation CreateTestModePayment( + $encoded_invoice: String! + $amount_msats: Long +) { + create_test_mode_payment(input: { + encoded_invoice: $encoded_invoice + amount_msats: $amount_msats + }) { + payment { + ...OutgoingPaymentFragment + } + } +} + +${OutgoingPaymentFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/CurrentWallet.ts b/packages/lightspark-wallet-sdk/src/graqhql/CurrentWallet.ts new file mode 100644 index 00000000..b39a3914 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/CurrentWallet.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { WalletFragment } from '@/objects' + +export const CurrentWalletQuery = ` +query CurrentWallet { + current_wallet { + ...WalletFragment + } +} + +${WalletFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/DecodeInvoice.ts b/packages/lightspark-wallet-sdk/src/graqhql/DecodeInvoice.ts new file mode 100644 index 00000000..6b48da0b --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/DecodeInvoice.ts @@ -0,0 +1,16 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { InvoiceDataFragment } from '@/objects' + +export const DecodeInvoiceQuery = ` + query DecodeInvoice($encoded_payment_request: String!) { + decoded_payment_request(encoded_payment_request: $encoded_payment_request) { + __typename + ... on InvoiceData { + ...InvoiceDataFragment + } + } + } + +${InvoiceDataFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/DeployWallet.ts b/packages/lightspark-wallet-sdk/src/graqhql/DeployWallet.ts new file mode 100644 index 00000000..6538c12f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/DeployWallet.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { DeployWalletOutputFragment } from '@/objects' + +export const DeployWallet = ` + mutation DeployWallet { + deploy_wallet { + ...DeployWalletOutputFragment + } + } + + ${DeployWalletOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/InitializeWallet.ts b/packages/lightspark-wallet-sdk/src/graqhql/InitializeWallet.ts new file mode 100644 index 00000000..a7ded327 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/InitializeWallet.ts @@ -0,0 +1,15 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { InitializeWalletOutputFragment } from '@/objects' + +export const InitializeWallet = ` + mutation InitializeWallet($key_type: KeyType!, $signing_public_key: String!) { + initialize_wallet(input: { + signing_public_key: { type: $key_type, public_key: $signing_public_key } + }) { + ...InitializeWalletOutputFragment + } + } + + ${InitializeWalletOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForInvoice.ts b/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForInvoice.ts new file mode 100644 index 00000000..44daea5f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForInvoice.ts @@ -0,0 +1,19 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightningFeeEstimateOutputFragment } from '@/objects' + +export const LightningFeeEstimateForInvoiceQuery = ` + query LightningFeeEstimateForInvoice( + $encoded_payment_request: String! + $amount_msats: Long + ) { + lightning_fee_estimate_for_invoice(input: { + encoded_payment_request: $encoded_payment_request, + amount_msats: $amount_msats + }) { + ...LightningFeeEstimateOutputFragment + } + } + + ${LightningFeeEstimateOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForNode.ts b/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForNode.ts new file mode 100644 index 00000000..428648ea --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/LightningFeeEstimateForNode.ts @@ -0,0 +1,19 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightningFeeEstimateOutputFragment } from '@/objects' + +export const LightningFeeEstimateForNodeQuery = ` + query LightningFeeEstimateForNode( + $destination_node_public_key: String! + $amount_msats: Long! + ) { + lightning_fee_estimate_for_node(input: { + destination_node_public_key: $destination_node_public_key, + amount_msats: $amount_msats + }) { + ...LightningFeeEstimateOutputFragment + } + } + + ${LightningFeeEstimateOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/LoginWithJWT.ts b/packages/lightspark-wallet-sdk/src/graqhql/LoginWithJWT.ts new file mode 100644 index 00000000..1d53f4b7 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/LoginWithJWT.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LoginWithJWTOutputFragment } from '@/objects' + +export const LoginWithJWT = ` + mutation LoginWithJWT($account_id: ID!, $jwt: String!) { + login_with_jwt(input: { account_id: $account_id, jwt: $jwt }) { + ...LoginWithJWTOutputFragment + } + } + + ${LoginWithJWTOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/PayInvoice.ts b/packages/lightspark-wallet-sdk/src/graqhql/PayInvoice.ts new file mode 100644 index 00000000..31e271f4 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/PayInvoice.ts @@ -0,0 +1,27 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { OutgoingPaymentFragment } from '@/objects' + +export const PayInvoiceMutation = ` + mutation PayInvoice( + $encoded_invoice: String! + $timeout_secs: Int! + $maximum_fees_msats: Long! + $amount_msats: Long + ) { + pay_invoice( + input: { + encoded_invoice: $encoded_invoice + timeout_secs: $timeout_secs + amount_msats: $amount_msats + maximum_fees_msats: $maximum_fees_msats + } + ) { + payment { + ...OutgoingPaymentFragment + } + } + } + + ${OutgoingPaymentFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/RequestWithdrawal.ts b/packages/lightspark-wallet-sdk/src/graqhql/RequestWithdrawal.ts new file mode 100644 index 00000000..ed7967aa --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/RequestWithdrawal.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { WithdrawalRequestFragment } from '@/objects' + +export const RequestWithdrawalMutation = ` + mutation RequestWithdrawal( + $amount_sats: Long! + $bitcoin_address: String! + ) { + request_withdrawal(input: { + amount_sats: $amount_sats + bitcoin_address: $bitcoin_address + }) { + request { + ...WithdrawalRequestFragment + } + } + } + + ${WithdrawalRequestFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/SendPayment.ts b/packages/lightspark-wallet-sdk/src/graqhql/SendPayment.ts new file mode 100644 index 00000000..69e6e1c4 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/SendPayment.ts @@ -0,0 +1,29 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { OutgoingPaymentFragment } from '@/objects' + +export const SendPaymentMutation = ` + mutation SendPayment( + $destination_public_key: String! + $timeout_secs: Int! + $amount_msats: Long! + $maximum_fees_msats: Long! + ) { + send_payment( + input: { + destination_public_key: $destination_public_key + timeout_secs: $timeout_secs + amount_msats: $amount_msats + maximum_fees_msats: $maximum_fees_msats + } + ) { + payment { + ...OutgoingPaymentFragment + } + } + } + + ${OutgoingPaymentFragment} +` + +export default SendPaymentMutation diff --git a/packages/lightspark-wallet-sdk/src/graqhql/TerminateWallet.ts b/packages/lightspark-wallet-sdk/src/graqhql/TerminateWallet.ts new file mode 100644 index 00000000..2f4714fa --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/TerminateWallet.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { TerminateWalletOutputFragment } from '@/objects' + +export const TerminateWallet = ` + mutation TerminateWallet { + terminate_wallet { + ...TerminateWalletOutputFragment + } + } + + ${TerminateWalletOutputFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/WalletDashboard.ts b/packages/lightspark-wallet-sdk/src/graqhql/WalletDashboard.ts new file mode 100644 index 00000000..721c48db --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/WalletDashboard.ts @@ -0,0 +1,63 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { + BalancesFragment, + PaymentRequestFragment, + TransactionFragment, +} from '@/objects' + +export const WalletDashboardQuery = ` +query WalletDashboard( + $numTransactions: Int, + $numPaymentRequests: Int, + $transactionsAfterDate: DateTime = null, + $paymentRequestsAfterDate: DateTime = null, + $transactionTypes: [TransactionType!] = [CHANNEL_OPEN, CHANNEL_CLOSE, L1_DEPOSIT, L1_WITHDRAW, INCOMING_PAYMENT, OUTGOING_PAYMENT], + $transactionStatuses: [TransactionStatus!] = [SUCCESS, FAILED, PENDING] +) { + current_wallet { + id + balances { + ...BalancesFragment + } + status + recent_transactions: transactions( + first: $numTransactions + types: $transactionTypes + statuses: $transactionStatuses + created_after_date: $transactionsAfterDate + ) { + wallet_to_transactions_connection_count: count + wallet_to_transactions_connection_entities: entities { + ...TransactionFragment + } + wallet_to_transactions_connection_page_info: page_info { + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + type: __typename + } + payment_requests( + first: $numPaymentRequests + created_after_date: $paymentRequestsAfterDate + ) { + wallet_to_payment_requests_connection_count: count + wallet_to_payment_requests_connection_entities: entities { + ...PaymentRequestFragment + } + wallet_to_payment_requests_connection_page_info: page_info { + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + } + } +} + +${TransactionFragment} +${BalancesFragment} +${PaymentRequestFragment} +` diff --git a/packages/lightspark-wallet-sdk/src/graqhql/index.ts b/packages/lightspark-wallet-sdk/src/graqhql/index.ts new file mode 100644 index 00000000..84aafb53 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/graqhql/index.ts @@ -0,0 +1,17 @@ +export * from './BitcoinFeeEstimate' +export * from './CreateBitcoinFundingAddress' +export * from './CreateInvoice' +export * from './CreateTestModeInvoice' +export * from './CreateTestModePayment' +export * from './CurrentWallet' +export * from './DecodeInvoice' +export * from './DeployWallet' +export * from './InitializeWallet' +export * from './LightningFeeEstimateForInvoice' +export * from './LightningFeeEstimateForNode' +export * from './LoginWithJWT' +export * from './PayInvoice' +export * from './RequestWithdrawal' +export * from './SendPayment' +export * from './TerminateWallet' +export * from './WalletDashboard' diff --git a/packages/lightspark-wallet-sdk/src/index.ts b/packages/lightspark-wallet-sdk/src/index.ts new file mode 100644 index 00000000..9ebc58f7 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/index.ts @@ -0,0 +1,4 @@ +export * from './auth' +export { LightsparkClient } from './client' +export * from './graqhql' +export * from './objects' diff --git a/packages/lightspark-wallet-sdk/src/objects/AmazonS3FundsRecoveryKit.ts b/packages/lightspark-wallet-sdk/src/objects/AmazonS3FundsRecoveryKit.ts new file mode 100644 index 00000000..a0b0ec64 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/AmazonS3FundsRecoveryKit.ts @@ -0,0 +1,32 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type FundsRecoveryKit } from '@/objects' + +export type AmazonS3FundsRecoveryKit = FundsRecoveryKit & { + /** The bitcoin address where the funds should be sent if the recovery kit is used. **/ + bitcoinWalletAddress: string + + /** The URL of the Amazon S3 bucket URL where we should upload the funds recovery kit. **/ + s3BucketUrl: string + + /** The typename of the object **/ + typename: string +} + +export const AmazonS3FundsRecoveryKitFromJson = ( + obj: any, +): AmazonS3FundsRecoveryKit => { + return { + bitcoinWalletAddress: + obj['amazon_s3_funds_recovery_kit_bitcoin_wallet_address'], + s3BucketUrl: obj['amazon_s3_funds_recovery_kit_s3_bucket_url'], + typename: 'AmazonS3FundsRecoveryKit', + } as AmazonS3FundsRecoveryKit +} + +export const AmazonS3FundsRecoveryKitFragment = ` +fragment AmazonS3FundsRecoveryKitFragment on AmazonS3FundsRecoveryKit { + __typename + amazon_s3_funds_recovery_kit_bitcoin_wallet_address: bitcoin_wallet_address + amazon_s3_funds_recovery_kit_s3_bucket_url: s3_bucket_url +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Balances.ts b/packages/lightspark-wallet-sdk/src/objects/Balances.ts new file mode 100644 index 00000000..021bc423 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Balances.ts @@ -0,0 +1,69 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type CurrencyAmount, CurrencyAmountFromJson } from '@/objects' + +export type 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. + **/ + 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). + **/ + 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). + **/ + availableToWithdrawBalance: CurrencyAmount +} + +export const BalancesFromJson = (obj: any): Balances => { + return { + ownedBalance: CurrencyAmountFromJson(obj['balances_owned_balance']), + availableToSendBalance: CurrencyAmountFromJson( + obj['balances_available_to_send_balance'], + ), + availableToWithdrawBalance: CurrencyAmountFromJson( + obj['balances_available_to_withdraw_balance'], + ), + } as Balances +} + +export const BalancesFragment = ` +fragment BalancesFragment on Balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/BitcoinNetwork.ts b/packages/lightspark-wallet-sdk/src/objects/BitcoinNetwork.ts new file mode 100644 index 00000000..27cf5d40 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/BitcoinNetwork.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + 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. **/ + SIGNET = 'SIGNET', + /** A test version of the Bitcoin Blockchain, publically available. **/ + TESTNET = 'TESTNET', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/ChannelClosingTransaction.ts b/packages/lightspark-wallet-sdk/src/objects/ChannelClosingTransaction.ts new file mode 100644 index 00000000..dbacd7bd --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/ChannelClosingTransaction.ts @@ -0,0 +1,147 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type OnChainTransaction, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** The transaction on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/ +export type ChannelClosingTransaction = OnChainTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** + * The height of the block that included this transaction. This will be zero for unconfirmed + * transactions. + **/ + blockHeight: number + + /** The Bitcoin blockchain addresses this transaction was sent to. **/ + destinationAddresses: string[] + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin + * blockchain. + **/ + fees?: CurrencyAmount + + /** + * The hash of the block that included this transaction. This will be null for unconfirmed + * transactions. + **/ + blockHash?: string + + /** The number of blockchain confirmations for this transaction in real time. **/ + numConfirmations?: number + } + +export const ChannelClosingTransactionFromJson = ( + obj: any, +): ChannelClosingTransaction => { + return { + id: obj['channel_closing_transaction_id'], + createdAt: obj['channel_closing_transaction_created_at'], + updatedAt: obj['channel_closing_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_closing_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_closing_transaction_amount']), + blockHeight: obj['channel_closing_transaction_block_height'], + destinationAddresses: + obj['channel_closing_transaction_destination_addresses'], + typename: 'ChannelClosingTransaction', + resolvedAt: obj['channel_closing_transaction_resolved_at'], + transactionHash: obj['channel_closing_transaction_transaction_hash'], + fees: obj['channel_closing_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_closing_transaction_fees']) + : undefined, + blockHash: obj['channel_closing_transaction_block_hash'], + numConfirmations: obj['channel_closing_transaction_num_confirmations'], + } as ChannelClosingTransaction +} + +const FRAGMENT = ` +fragment ChannelClosingTransactionFragment on ChannelClosingTransaction { + __typename + channel_closing_transaction_id: id + channel_closing_transaction_created_at: created_at + channel_closing_transaction_updated_at: updated_at + channel_closing_transaction_status: status + channel_closing_transaction_resolved_at: resolved_at + channel_closing_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_transaction_hash: transaction_hash + channel_closing_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_block_hash: block_hash + channel_closing_transaction_block_height: block_height + channel_closing_transaction_destination_addresses: destination_addresses + channel_closing_transaction_num_confirmations: num_confirmations +}` + +export const getChannelClosingTransactionQuery = ( + id: string, +): Query => { + return { + queryPayload: ` +query GetChannelClosingTransaction($id: ID!) { + entity(id: $id) { + ... on ChannelClosingTransaction { + ...ChannelClosingTransactionFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => + ChannelClosingTransactionFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/ChannelOpeningTransaction.ts b/packages/lightspark-wallet-sdk/src/objects/ChannelOpeningTransaction.ts new file mode 100644 index 00000000..ce2b3280 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/ChannelOpeningTransaction.ts @@ -0,0 +1,147 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type OnChainTransaction, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** The transaction on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/ +export type ChannelOpeningTransaction = OnChainTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** + * The height of the block that included this transaction. This will be zero for unconfirmed + * transactions. + **/ + blockHeight: number + + /** The Bitcoin blockchain addresses this transaction was sent to. **/ + destinationAddresses: string[] + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin + * blockchain. + **/ + fees?: CurrencyAmount + + /** + * The hash of the block that included this transaction. This will be null for unconfirmed + * transactions. + **/ + blockHash?: string + + /** The number of blockchain confirmations for this transaction in real time. **/ + numConfirmations?: number + } + +export const ChannelOpeningTransactionFromJson = ( + obj: any, +): ChannelOpeningTransaction => { + return { + id: obj['channel_opening_transaction_id'], + createdAt: obj['channel_opening_transaction_created_at'], + updatedAt: obj['channel_opening_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_opening_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_opening_transaction_amount']), + blockHeight: obj['channel_opening_transaction_block_height'], + destinationAddresses: + obj['channel_opening_transaction_destination_addresses'], + typename: 'ChannelOpeningTransaction', + resolvedAt: obj['channel_opening_transaction_resolved_at'], + transactionHash: obj['channel_opening_transaction_transaction_hash'], + fees: obj['channel_opening_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_opening_transaction_fees']) + : undefined, + blockHash: obj['channel_opening_transaction_block_hash'], + numConfirmations: obj['channel_opening_transaction_num_confirmations'], + } as ChannelOpeningTransaction +} + +const FRAGMENT = ` +fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction { + __typename + channel_opening_transaction_id: id + channel_opening_transaction_created_at: created_at + channel_opening_transaction_updated_at: updated_at + channel_opening_transaction_status: status + channel_opening_transaction_resolved_at: resolved_at + channel_opening_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_transaction_hash: transaction_hash + channel_opening_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_block_hash: block_hash + channel_opening_transaction_block_height: block_height + channel_opening_transaction_destination_addresses: destination_addresses + channel_opening_transaction_num_confirmations: num_confirmations +}` + +export const getChannelOpeningTransactionQuery = ( + id: string, +): Query => { + return { + queryPayload: ` +query GetChannelOpeningTransaction($id: ID!) { + entity(id: $id) { + ... on ChannelOpeningTransaction { + ...ChannelOpeningTransactionFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => + ChannelOpeningTransactionFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateBitcoinFundingAddressOutput.ts b/packages/lightspark-wallet-sdk/src/objects/CreateBitcoinFundingAddressOutput.ts new file mode 100644 index 00000000..d808880c --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateBitcoinFundingAddressOutput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type CreateBitcoinFundingAddressOutput = { + bitcoinAddress: string +} + +export const CreateBitcoinFundingAddressOutputFromJson = ( + obj: any, +): CreateBitcoinFundingAddressOutput => { + return { + bitcoinAddress: + obj['create_bitcoin_funding_address_output_bitcoin_address'], + } as CreateBitcoinFundingAddressOutput +} + +export const CreateBitcoinFundingAddressOutputFragment = ` +fragment CreateBitcoinFundingAddressOutputFragment on CreateBitcoinFundingAddressOutput { + __typename + create_bitcoin_funding_address_output_bitcoin_address: bitcoin_address +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceInput.ts b/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceInput.ts new file mode 100644 index 00000000..20f18ad7 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceInput.ts @@ -0,0 +1,24 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { InvoiceType } from '@/objects' + +export type CreateInvoiceInput = { + amountMsats: number + + memo?: string + + invoiceType?: InvoiceType +} + +export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => { + return { + amountMsats: obj['create_invoice_input_amount_msats'], + memo: obj['create_invoice_input_memo'], + invoiceType: obj['create_invoice_input_invoice_type'] + ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + InvoiceType[obj['create_invoice_input_invoice_type']] ?? + InvoiceType.FUTURE_VALUE + : null, + } as CreateInvoiceInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceOutput.ts b/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceOutput.ts new file mode 100644 index 00000000..624bce65 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateInvoiceOutput.ts @@ -0,0 +1,19 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type CreateInvoiceOutput = { + invoiceId: string +} + +export const CreateInvoiceOutputFromJson = (obj: any): CreateInvoiceOutput => { + return { + invoiceId: obj['create_invoice_output_invoice'].id, + } as CreateInvoiceOutput +} + +export const CreateInvoiceOutputFragment = ` +fragment CreateInvoiceOutputFragment on CreateInvoiceOutput { + __typename + create_invoice_output_invoice: invoice { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceInputWallet.ts b/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceInputWallet.ts new file mode 100644 index 00000000..ca03545e --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceInputWallet.ts @@ -0,0 +1,27 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { InvoiceType } from '@/objects' + +export type CreateTestModeInvoiceInputWallet = { + amountMsats: number + + memo?: string + + invoiceType?: InvoiceType +} + +export const CreateTestModeInvoiceInputWalletFromJson = ( + obj: any, +): CreateTestModeInvoiceInputWallet => { + return { + amountMsats: obj['create_test_mode_invoice_input_wallet_amount_msats'], + memo: obj['create_test_mode_invoice_input_wallet_memo'], + invoiceType: obj['create_test_mode_invoice_input_wallet_invoice_type'] + ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + InvoiceType[ + obj['create_test_mode_invoice_input_wallet_invoice_type'] + ] ?? InvoiceType.FUTURE_VALUE + : null, + } as CreateTestModeInvoiceInputWallet +} diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceOutput.ts b/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceOutput.ts new file mode 100644 index 00000000..d25199f5 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateTestModeInvoiceOutput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type CreateTestModeInvoiceOutput = { + encodedPaymentRequest: string +} + +export const CreateTestModeInvoiceOutputFromJson = ( + obj: any, +): CreateTestModeInvoiceOutput => { + return { + encodedPaymentRequest: + obj['create_test_mode_invoice_output_encoded_payment_request'], + } as CreateTestModeInvoiceOutput +} + +export const CreateTestModeInvoiceOutputFragment = ` +fragment CreateTestModeInvoiceOutputFragment on CreateTestModeInvoiceOutput { + __typename + create_test_mode_invoice_output_encoded_payment_request: encoded_payment_request +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentInputWallet.ts b/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentInputWallet.ts new file mode 100644 index 00000000..91f0b2b9 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentInputWallet.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type CreateTestModePaymentInputWallet = { + /** The invoice you want to be paid (as defined by the BOLT11 standard). **/ + 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. + **/ + amountMsats?: number +} + +export const CreateTestModePaymentInputWalletFromJson = ( + obj: any, +): CreateTestModePaymentInputWallet => { + return { + encodedInvoice: + obj['create_test_mode_payment_input_wallet_encoded_invoice'], + amountMsats: obj['create_test_mode_payment_input_wallet_amount_msats'], + } as CreateTestModePaymentInputWallet +} diff --git a/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentoutput.ts b/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentoutput.ts new file mode 100644 index 00000000..4d2d8796 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CreateTestModePaymentoutput.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type CreateTestModePaymentoutput = { + /** The payment that has been sent. **/ + paymentId: string +} + +export const CreateTestModePaymentoutputFromJson = ( + obj: any, +): CreateTestModePaymentoutput => { + return { + paymentId: obj['create_test_mode_paymentoutput_payment'].id, + } as CreateTestModePaymentoutput +} + +export const CreateTestModePaymentoutputFragment = ` +fragment CreateTestModePaymentoutputFragment on CreateTestModePaymentoutput { + __typename + create_test_mode_paymentoutput_payment: payment { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/CurrencyAmount.ts b/packages/lightspark-wallet-sdk/src/objects/CurrencyAmount.ts new file mode 100644 index 00000000..8670d3f9 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CurrencyAmount.ts @@ -0,0 +1,57 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { CurrencyUnit } from '@/objects' + +/** Represents the value and unit for an amount of currency. **/ +export type CurrencyAmount = { + /** The original numeric value for this CurrencyAmount. **/ + originalValue: number + + /** The original unit of currency for this CurrencyAmount. **/ + originalUnit: CurrencyUnit + + /** 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. + **/ + 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. + **/ + preferredCurrencyValueApprox: number +} + +export const CurrencyAmountFromJson = (obj: any): CurrencyAmount => { + return { + originalValue: obj['currency_amount_original_value'], + originalUnit: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + CurrencyUnit[obj['currency_amount_original_unit']] ?? + CurrencyUnit.FUTURE_VALUE, + preferredCurrencyUnit: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + CurrencyUnit[obj['currency_amount_preferred_currency_unit']] ?? + CurrencyUnit.FUTURE_VALUE, + preferredCurrencyValueRounded: + obj['currency_amount_preferred_currency_value_rounded'], + preferredCurrencyValueApprox: + obj['currency_amount_preferred_currency_value_approx'], + } as CurrencyAmount +} + +export const CurrencyAmountFragment = ` +fragment CurrencyAmountFragment on CurrencyAmount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/CurrencyUnit.ts b/packages/lightspark-wallet-sdk/src/objects/CurrencyUnit.ts new file mode 100644 index 00000000..13301258 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/CurrencyUnit.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + 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 = 'BITCOIN', + /** 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. **/ + 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. **/ + NANOBITCOIN = 'NANOBITCOIN', + /** 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. **/ + MILLIBITCOIN = 'MILLIBITCOIN', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/DeleteFundsRecoveryKitOutput.ts b/packages/lightspark-wallet-sdk/src/objects/DeleteFundsRecoveryKitOutput.ts new file mode 100644 index 00000000..19f5d988 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/DeleteFundsRecoveryKitOutput.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type DeleteFundsRecoveryKitOutput = { + walletId: string +} + +export const DeleteFundsRecoveryKitOutputFromJson = ( + obj: any, +): DeleteFundsRecoveryKitOutput => { + return { + walletId: obj['delete_funds_recovery_kit_output_wallet'].id, + } as DeleteFundsRecoveryKitOutput +} + +export const DeleteFundsRecoveryKitOutputFragment = ` +fragment DeleteFundsRecoveryKitOutputFragment on DeleteFundsRecoveryKitOutput { + __typename + delete_funds_recovery_kit_output_wallet: wallet { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/DeployWalletOutput.ts b/packages/lightspark-wallet-sdk/src/objects/DeployWalletOutput.ts new file mode 100644 index 00000000..4561990f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/DeployWalletOutput.ts @@ -0,0 +1,52 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { Wallet, WalletFromJson } from '@/objects' + +export type DeployWalletOutput = { + wallet: Wallet +} + +export const DeployWalletOutputFromJson = (obj: any): DeployWalletOutput => { + return { + wallet: WalletFromJson(obj['deploy_wallet_output_wallet']), + } as DeployWalletOutput +} + +export const DeployWalletOutputFragment = ` +fragment DeployWalletOutputFragment on DeployWalletOutput { + __typename + deploy_wallet_output_wallet: wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Deposit.ts b/packages/lightspark-wallet-sdk/src/objects/Deposit.ts new file mode 100644 index 00000000..a1ee952f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Deposit.ts @@ -0,0 +1,141 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type OnChainTransaction, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** The transaction on Bitcoin blockchain to fund the Lightspark node's wallet. **/ +export type Deposit = OnChainTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** + * The height of the block that included this transaction. This will be zero for unconfirmed + * transactions. + **/ + blockHeight: number + + /** The Bitcoin blockchain addresses this transaction was sent to. **/ + destinationAddresses: string[] + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin + * blockchain. + **/ + fees?: CurrencyAmount + + /** + * The hash of the block that included this transaction. This will be null for unconfirmed + * transactions. + **/ + blockHash?: string + + /** The number of blockchain confirmations for this transaction in real time. **/ + numConfirmations?: number + } + +export const DepositFromJson = (obj: any): Deposit => { + return { + id: obj['deposit_id'], + createdAt: obj['deposit_created_at'], + updatedAt: obj['deposit_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['deposit_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['deposit_amount']), + blockHeight: obj['deposit_block_height'], + destinationAddresses: obj['deposit_destination_addresses'], + typename: 'Deposit', + resolvedAt: obj['deposit_resolved_at'], + transactionHash: obj['deposit_transaction_hash'], + fees: obj['deposit_fees'] + ? CurrencyAmountFromJson(obj['deposit_fees']) + : undefined, + blockHash: obj['deposit_block_hash'], + numConfirmations: obj['deposit_num_confirmations'], + } as Deposit +} + +const FRAGMENT = ` +fragment DepositFragment on Deposit { + __typename + deposit_id: id + deposit_created_at: created_at + deposit_updated_at: updated_at + deposit_status: status + deposit_resolved_at: resolved_at + deposit_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_transaction_hash: transaction_hash + deposit_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_block_hash: block_hash + deposit_block_height: block_height + deposit_destination_addresses: destination_addresses + deposit_num_confirmations: num_confirmations +}` + +export const getDepositQuery = (id: string): Query => { + return { + queryPayload: ` +query GetDeposit($id: ID!) { + entity(id: $id) { + ... on Deposit { + ...DepositFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => DepositFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/Entity.ts b/packages/lightspark-wallet-sdk/src/objects/Entity.ts new file mode 100644 index 00000000..19b22d6b --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Entity.ts @@ -0,0 +1,340 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +/** This interface is used by all the entities in the Lightspark systems. 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. **/ +export type Entity = { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when the entity was first created. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The typename of the object **/ + typename: string +} + +export const EntityFragment = ` +fragment EntityFragment on Entity { + __typename + ... on ChannelClosingTransaction { + __typename + channel_closing_transaction_id: id + channel_closing_transaction_created_at: created_at + channel_closing_transaction_updated_at: updated_at + channel_closing_transaction_status: status + channel_closing_transaction_resolved_at: resolved_at + channel_closing_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_transaction_hash: transaction_hash + channel_closing_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_block_hash: block_hash + channel_closing_transaction_block_height: block_height + channel_closing_transaction_destination_addresses: destination_addresses + channel_closing_transaction_num_confirmations: num_confirmations + } + ... on ChannelOpeningTransaction { + __typename + channel_opening_transaction_id: id + channel_opening_transaction_created_at: created_at + channel_opening_transaction_updated_at: updated_at + channel_opening_transaction_status: status + channel_opening_transaction_resolved_at: resolved_at + channel_opening_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_transaction_hash: transaction_hash + channel_opening_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_block_hash: block_hash + channel_opening_transaction_block_height: block_height + channel_opening_transaction_destination_addresses: destination_addresses + channel_opening_transaction_num_confirmations: num_confirmations + } + ... on Deposit { + __typename + deposit_id: id + deposit_created_at: created_at + deposit_updated_at: updated_at + deposit_status: status + deposit_resolved_at: resolved_at + deposit_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_transaction_hash: transaction_hash + deposit_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_block_hash: block_hash + deposit_block_height: block_height + deposit_destination_addresses: destination_addresses + deposit_num_confirmations: num_confirmations + } + ... on GraphNode { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + ... on IncomingPayment { + __typename + incoming_payment_id: id + incoming_payment_created_at: created_at + incoming_payment_updated_at: updated_at + incoming_payment_status: status + incoming_payment_resolved_at: resolved_at + incoming_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + incoming_payment_transaction_hash: transaction_hash + incoming_payment_payment_request: payment_request { + id + } + } + ... on Invoice { + __typename + invoice_id: id + invoice_created_at: created_at + invoice_updated_at: updated_at + invoice_data: data { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + invoice_status: status + invoice_amount_paid: amount_paid { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + ... on OutgoingPayment { + __typename + outgoing_payment_id: id + outgoing_payment_created_at: created_at + outgoing_payment_updated_at: updated_at + outgoing_payment_status: status + outgoing_payment_resolved_at: resolved_at + outgoing_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_transaction_hash: transaction_hash + outgoing_payment_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_payment_request_data: payment_request_data { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + } + outgoing_payment_failure_reason: failure_reason + outgoing_payment_failure_message: failure_message { + __typename + rich_text_text: text + } + } + ... on Wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status + } + ... on Withdrawal { + __typename + withdrawal_id: id + withdrawal_created_at: created_at + withdrawal_updated_at: updated_at + withdrawal_status: status + withdrawal_resolved_at: resolved_at + withdrawal_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_transaction_hash: transaction_hash + withdrawal_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_block_hash: block_hash + withdrawal_block_height: block_height + withdrawal_destination_addresses: destination_addresses + withdrawal_num_confirmations: num_confirmations + } + ... on WithdrawalRequest { + __typename + withdrawal_request_id: id + withdrawal_request_created_at: created_at + withdrawal_request_updated_at: updated_at + withdrawal_request_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_request_estimated_amount: estimated_amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_request_bitcoin_address: bitcoin_address + withdrawal_request_status: status + withdrawal_request_completed_at: completed_at + withdrawal_request_withdrawal: withdrawal { + id + } + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/FeeEstimate.ts b/packages/lightspark-wallet-sdk/src/objects/FeeEstimate.ts new file mode 100644 index 00000000..25afb35b --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/FeeEstimate.ts @@ -0,0 +1,37 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type CurrencyAmount, CurrencyAmountFromJson } from '@/objects' + +export type FeeEstimate = { + feeFast: CurrencyAmount + + feeMin: CurrencyAmount +} + +export const FeeEstimateFromJson = (obj: any): FeeEstimate => { + return { + feeFast: CurrencyAmountFromJson(obj['fee_estimate_fee_fast']), + feeMin: CurrencyAmountFromJson(obj['fee_estimate_fee_min']), + } as FeeEstimate +} + +export const FeeEstimateFragment = ` +fragment FeeEstimateFragment on FeeEstimate { + __typename + fee_estimate_fee_fast: fee_fast { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + fee_estimate_fee_min: fee_min { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/FundsRecoveryKit.ts b/packages/lightspark-wallet-sdk/src/objects/FundsRecoveryKit.ts new file mode 100644 index 00000000..7251a95f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/FundsRecoveryKit.ts @@ -0,0 +1,38 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException } from '@lightsparkdev/core' + +import { type AmazonS3FundsRecoveryKit } from '@/objects' + +export type FundsRecoveryKit = { + /** The bitcoin address where the funds should be sent if the recovery kit is used. **/ + bitcoinWalletAddress: string + + /** The typename of the object **/ + typename: string +} + +export const FundsRecoveryKitFromJson = (obj: any): FundsRecoveryKit => { + if (obj['__typename'] == 'AmazonS3FundsRecoveryKit') { + return { + bitcoinWalletAddress: + obj['amazon_s3_funds_recovery_kit_bitcoin_wallet_address'], + s3BucketUrl: obj['amazon_s3_funds_recovery_kit_s3_bucket_url'], + typename: 'AmazonS3FundsRecoveryKit', + } as AmazonS3FundsRecoveryKit + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface FundsRecoveryKit corresponding to the typename=${obj['__typename']}`, + ) +} + +export const FundsRecoveryKitFragment = ` +fragment FundsRecoveryKitFragment on FundsRecoveryKit { + __typename + ... on AmazonS3FundsRecoveryKit { + __typename + amazon_s3_funds_recovery_kit_bitcoin_wallet_address: bitcoin_wallet_address + amazon_s3_funds_recovery_kit_s3_bucket_url: s3_bucket_url + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/GraphNode.ts b/packages/lightspark-wallet-sdk/src/objects/GraphNode.ts new file mode 100644 index 00000000..b68fcff3 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/GraphNode.ts @@ -0,0 +1,112 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' +import autoBind from 'auto-bind' + +import { LightsparkClient } from '@/client' +import { + BitcoinNetwork, + Node, + NodeAddressType, + type NodeToAddressesConnection, + NodeToAddressesConnectionFromJson, +} from '@/objects' + +/** This is a node on the Lightning Network, managed by a third party. The information about this node is public data that has been obtained by observing the Lightning Network. **/ +export class GraphNode implements Node { + constructor( + public readonly id: string, + public readonly createdAt: string, + public readonly updatedAt: string, + public readonly bitcoinNetwork: BitcoinNetwork, + public readonly displayName: string, + public readonly typename: string, + public readonly alias?: string, + public readonly color?: string, + public readonly conductivity?: number, + public readonly publicKey?: string, + ) { + autoBind(this) + } + + public async getAddresses( + client: LightsparkClient, + first: number | undefined = undefined, + types: NodeAddressType[] | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) { + entity(id: $entity_id) { + ... on GraphNode { + addresses(, first: $first, types: $types) { + __typename + node_to_addresses_connection_count: count + node_to_addresses_connection_entities: entities { + __typename + node_address_address: address + node_address_type: type + } + } + } + } +} +`, + variables: { entity_id: this.id, first: first, types: types }, + constructObject: json => { + const connection = json['entity']['addresses'] + return NodeToAddressesConnectionFromJson(connection) + }, + }))! + } + + static getGraphNodeQuery(id: string): Query { + return { + queryPayload: ` +query GetGraphNode($id: ID!) { + entity(id: $id) { + ... on GraphNode { + ...GraphNodeFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => GraphNodeFromJson(data.entity), + } + } +} + +export const GraphNodeFromJson = (obj: any): GraphNode => { + return new GraphNode( + obj['graph_node_id'], + obj['graph_node_created_at'], + obj['graph_node_updated_at'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + BitcoinNetwork[obj['graph_node_bitcoin_network']] ?? + BitcoinNetwork.FUTURE_VALUE, + obj['graph_node_display_name'], + 'GraphNode', + obj['graph_node_alias'], + obj['graph_node_color'], + obj['graph_node_conductivity'], + obj['graph_node_public_key'], + ) +} + +const FRAGMENT = ` +fragment GraphNodeFragment on GraphNode { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/IncomingPayment.ts b/packages/lightspark-wallet-sdk/src/objects/IncomingPayment.ts new file mode 100644 index 00000000..1c9534d0 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/IncomingPayment.ts @@ -0,0 +1,108 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type LightningTransaction, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** A transaction that was sent to a Lightspark node on the Lightning Network. **/ +export type IncomingPayment = LightningTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The optional payment request for this incoming payment, which will be null if the payment is sent + * through keysend. + **/ + paymentRequestId?: string + } + +export const IncomingPaymentFromJson = (obj: any): IncomingPayment => { + return { + id: obj['incoming_payment_id'], + createdAt: obj['incoming_payment_created_at'], + updatedAt: obj['incoming_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['incoming_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['incoming_payment_amount']), + typename: 'IncomingPayment', + resolvedAt: obj['incoming_payment_resolved_at'], + transactionHash: obj['incoming_payment_transaction_hash'], + paymentRequestId: obj['incoming_payment_payment_request']?.id ?? undefined, + } as IncomingPayment +} + +const FRAGMENT = ` +fragment IncomingPaymentFragment on IncomingPayment { + __typename + incoming_payment_id: id + incoming_payment_created_at: created_at + incoming_payment_updated_at: updated_at + incoming_payment_status: status + incoming_payment_resolved_at: resolved_at + incoming_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + incoming_payment_transaction_hash: transaction_hash + incoming_payment_payment_request: payment_request { + id + } +}` + +export const getIncomingPaymentQuery = (id: string): Query => { + return { + queryPayload: ` +query GetIncomingPayment($id: ID!) { + entity(id: $id) { + ... on IncomingPayment { + ...IncomingPaymentFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => IncomingPaymentFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/InitializeWalletInput.ts b/packages/lightspark-wallet-sdk/src/objects/InitializeWalletInput.ts new file mode 100644 index 00000000..7c9921fa --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/InitializeWalletInput.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type KeyInput, KeyInputFromJson } from '@/objects' + +export type InitializeWalletInput = { + signingPublicKey: KeyInput +} + +export const InitializeWalletInputFromJson = ( + obj: any, +): InitializeWalletInput => { + return { + signingPublicKey: KeyInputFromJson( + obj['initialize_wallet_input_signing_public_key'], + ), + } as InitializeWalletInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/InitializeWalletOutput.ts b/packages/lightspark-wallet-sdk/src/objects/InitializeWalletOutput.ts new file mode 100644 index 00000000..11942e64 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/InitializeWalletOutput.ts @@ -0,0 +1,54 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Wallet, WalletFromJson } from '@/objects' + +export type InitializeWalletOutput = { + wallet: Wallet +} + +export const InitializeWalletOutputFromJson = ( + obj: any, +): InitializeWalletOutput => { + return { + wallet: WalletFromJson(obj['initialize_wallet_output_wallet']), + } as InitializeWalletOutput +} + +export const InitializeWalletOutputFragment = ` +fragment InitializeWalletOutputFragment on InitializeWalletOutput { + __typename + initialize_wallet_output_wallet: wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Invoice.ts b/packages/lightspark-wallet-sdk/src/objects/Invoice.ts new file mode 100644 index 00000000..e26d2699 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Invoice.ts @@ -0,0 +1,123 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type { Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type InvoiceData, + InvoiceDataFromJson, + type PaymentRequest, + PaymentRequestStatus, +} from '@/objects' + +/** This object represents a BOLT #11 invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) initiated by a Lightspark Node. **/ +export type Invoice = PaymentRequest & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when the entity was first created. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The details of the invoice. **/ + data: InvoiceData + + /** The status of the payment request. **/ + status: PaymentRequestStatus + + /** The typename of the object **/ + typename: string + + /** The total amount that has been paid to this invoice. **/ + amountPaid?: CurrencyAmount + } + +export const InvoiceFromJson = (obj: any): Invoice => { + return { + id: obj['invoice_id'], + createdAt: obj['invoice_created_at'], + updatedAt: obj['invoice_updated_at'], + data: InvoiceDataFromJson(obj['invoice_data']), + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + PaymentRequestStatus[obj['invoice_status']] ?? + PaymentRequestStatus.FUTURE_VALUE, + typename: 'Invoice', + amountPaid: obj['invoice_amount_paid'] + ? CurrencyAmountFromJson(obj['invoice_amount_paid']) + : undefined, + } as Invoice +} + +const FRAGMENT = ` +fragment InvoiceFragment on Invoice { + __typename + invoice_id: id + invoice_created_at: created_at + invoice_updated_at: updated_at + invoice_data: data { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + invoice_status: status + invoice_amount_paid: amount_paid { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } +}` + +export const getInvoiceQuery = (id: string): Query => { + return { + queryPayload: ` +query GetInvoice($id: ID!) { + entity(id: $id) { + ... on Invoice { + ...InvoiceFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => InvoiceFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/InvoiceData.ts b/packages/lightspark-wallet-sdk/src/objects/InvoiceData.ts new file mode 100644 index 00000000..d9012e34 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/InvoiceData.ts @@ -0,0 +1,90 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { + BitcoinNetwork, + type CurrencyAmount, + CurrencyAmountFromJson, + GraphNode, + GraphNodeFromJson, + type PaymentRequestData, +} from '@/objects' + +/** This object represents the BOLT #11 invoice protocol for Lightning Payments. See https://github.com/lightning/bolts/blob/master/11-payment-encoding.md. **/ +export type InvoiceData = PaymentRequestData & { + encodedPaymentRequest: string + + bitcoinNetwork: BitcoinNetwork + + /** The payment hash of this invoice. **/ + paymentHash: string + + /** + * The requested amount in this invoice. If it is equal to 0, the sender should choose the amount to + * send. + **/ + amount: CurrencyAmount + + /** The date and time when this invoice was created. **/ + createdAt: string + + /** The date and time when this invoice will expire. **/ + expiresAt: string + + /** The lightning node that will be paid when fulfilling this invoice. **/ + destination: GraphNode + + /** The typename of the object **/ + typename: string + + /** A short, UTF-8 encoded, description of the purpose of this invoice. **/ + memo?: string +} + +export const InvoiceDataFromJson = (obj: any): InvoiceData => { + return { + encodedPaymentRequest: obj['invoice_data_encoded_payment_request'], + bitcoinNetwork: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + BitcoinNetwork[obj['invoice_data_bitcoin_network']] ?? + BitcoinNetwork.FUTURE_VALUE, + paymentHash: obj['invoice_data_payment_hash'], + amount: CurrencyAmountFromJson(obj['invoice_data_amount']), + createdAt: obj['invoice_data_created_at'], + expiresAt: obj['invoice_data_expires_at'], + destination: GraphNodeFromJson(obj['invoice_data_destination']), + typename: 'InvoiceData', + memo: obj['invoice_data_memo'], + } as InvoiceData +} + +export const InvoiceDataFragment = ` +fragment InvoiceDataFragment on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/InvoiceType.ts b/packages/lightspark-wallet-sdk/src/objects/InvoiceType.ts new file mode 100644 index 00000000..638b84c1 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/InvoiceType.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + /** A standard Bolt 11 invoice. **/ + STANDARD = 'STANDARD', + /** An AMP (Atomic Multi-path Payment) invoice. **/ + AMP = 'AMP', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/KeyInput.ts b/packages/lightspark-wallet-sdk/src/objects/KeyInput.ts new file mode 100644 index 00000000..4402e7c3 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/KeyInput.ts @@ -0,0 +1,18 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { KeyType } from '@/objects' + +export type KeyInput = { + type: KeyType + + publicKey: string +} + +export const KeyInputFromJson = (obj: any): KeyInput => { + return { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + type: KeyType[obj['key_input_type']] ?? KeyType.FUTURE_VALUE, + publicKey: obj['key_input_public_key'], + } as KeyInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/KeyType.ts b/packages/lightspark-wallet-sdk/src/objects/KeyType.ts new file mode 100644 index 00000000..c007345d --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/KeyType.ts @@ -0,0 +1,11 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export enum KeyType { + /** + * 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', + + RSA_OAEP = 'RSA_OAEP', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts new file mode 100644 index 00000000..8cccfd57 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type LightningFeeEstimateForInvoiceInput = { + /** The invoice you want to pay (as defined by the BOLT11 standard). **/ + encodedPaymentRequest: string + + /** + * If the invoice does not specify a payment amount, then the amount that you wish to pay, expressed + * in msats. + **/ + amountMsats?: number +} + +export const LightningFeeEstimateForInvoiceInputFromJson = ( + obj: any, +): LightningFeeEstimateForInvoiceInput => { + return { + encodedPaymentRequest: + obj['lightning_fee_estimate_for_invoice_input_encoded_payment_request'], + amountMsats: obj['lightning_fee_estimate_for_invoice_input_amount_msats'], + } as LightningFeeEstimateForInvoiceInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForNodeInput.ts b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForNodeInput.ts new file mode 100644 index 00000000..c0f18603 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateForNodeInput.ts @@ -0,0 +1,19 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type LightningFeeEstimateForNodeInput = { + /** The public key of the node that you want to pay. **/ + destinationNodePublicKey: string + + /** The payment amount expressed in msats. **/ + amountMsats: number +} + +export const LightningFeeEstimateForNodeInputFromJson = ( + obj: any, +): LightningFeeEstimateForNodeInput => { + return { + destinationNodePublicKey: + obj['lightning_fee_estimate_for_node_input_destination_node_public_key'], + amountMsats: obj['lightning_fee_estimate_for_node_input_amount_msats'], + } as LightningFeeEstimateForNodeInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateOutput.ts b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateOutput.ts new file mode 100644 index 00000000..e60e3e38 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LightningFeeEstimateOutput.ts @@ -0,0 +1,31 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type CurrencyAmount, CurrencyAmountFromJson } from '@/objects' + +export type LightningFeeEstimateOutput = { + /** The estimated fees for the payment. **/ + feeEstimate: CurrencyAmount +} + +export const LightningFeeEstimateOutputFromJson = ( + obj: any, +): LightningFeeEstimateOutput => { + return { + feeEstimate: CurrencyAmountFromJson( + obj['lightning_fee_estimate_output_fee_estimate'], + ), + } as LightningFeeEstimateOutput +} + +export const LightningFeeEstimateOutputFragment = ` +fragment LightningFeeEstimateOutputFragment on LightningFeeEstimateOutput { + __typename + lightning_fee_estimate_output_fee_estimate: fee_estimate { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/LightningTransaction.ts b/packages/lightspark-wallet-sdk/src/objects/LightningTransaction.ts new file mode 100644 index 00000000..b6cfc9be --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LightningTransaction.ts @@ -0,0 +1,213 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException, type Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type IncomingPayment, + type OutgoingPayment, + PaymentFailureReason, + PaymentRequestDataFromJson, + RichTextFromJson, + type Transaction, + TransactionStatus, +} from '@/objects' + +export type LightningTransaction = Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + } + +export const LightningTransactionFromJson = ( + obj: any, +): LightningTransaction => { + if (obj['__typename'] == 'IncomingPayment') { + return { + id: obj['incoming_payment_id'], + createdAt: obj['incoming_payment_created_at'], + updatedAt: obj['incoming_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['incoming_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['incoming_payment_amount']), + typename: 'IncomingPayment', + resolvedAt: obj['incoming_payment_resolved_at'], + transactionHash: obj['incoming_payment_transaction_hash'], + paymentRequestId: + obj['incoming_payment_payment_request']?.id ?? undefined, + } as IncomingPayment + } + if (obj['__typename'] == 'OutgoingPayment') { + return { + id: obj['outgoing_payment_id'], + createdAt: obj['outgoing_payment_created_at'], + updatedAt: obj['outgoing_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['outgoing_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['outgoing_payment_amount']), + typename: 'OutgoingPayment', + resolvedAt: obj['outgoing_payment_resolved_at'], + transactionHash: obj['outgoing_payment_transaction_hash'], + fees: obj['outgoing_payment_fees'] + ? CurrencyAmountFromJson(obj['outgoing_payment_fees']) + : undefined, + paymentRequestData: obj['outgoing_payment_payment_request_data'] + ? PaymentRequestDataFromJson( + obj['outgoing_payment_payment_request_data'], + ) + : undefined, + failureReason: obj['outgoing_payment_failure_reason'] + ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + PaymentFailureReason[obj['outgoing_payment_failure_reason']] ?? + PaymentFailureReason.FUTURE_VALUE + : null, + failureMessage: obj['outgoing_payment_failure_message'] + ? RichTextFromJson(obj['outgoing_payment_failure_message']) + : undefined, + } as OutgoingPayment + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj['__typename']}`, + ) +} + +const FRAGMENT = ` +fragment LightningTransactionFragment on LightningTransaction { + __typename + ... on IncomingPayment { + __typename + incoming_payment_id: id + incoming_payment_created_at: created_at + incoming_payment_updated_at: updated_at + incoming_payment_status: status + incoming_payment_resolved_at: resolved_at + incoming_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + incoming_payment_transaction_hash: transaction_hash + incoming_payment_payment_request: payment_request { + id + } + } + ... on OutgoingPayment { + __typename + outgoing_payment_id: id + outgoing_payment_created_at: created_at + outgoing_payment_updated_at: updated_at + outgoing_payment_status: status + outgoing_payment_resolved_at: resolved_at + outgoing_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_transaction_hash: transaction_hash + outgoing_payment_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_payment_request_data: payment_request_data { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + } + outgoing_payment_failure_reason: failure_reason + outgoing_payment_failure_message: failure_message { + __typename + rich_text_text: text + } + } +}` + +export const getLightningTransactionQuery = ( + id: string, +): Query => { + return { + queryPayload: ` +query GetLightningTransaction($id: ID!) { + entity(id: $id) { + ... on LightningTransaction { + ...LightningTransactionFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => LightningTransactionFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTInput.ts b/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTInput.ts new file mode 100644 index 00000000..eeeb4fa3 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTInput.ts @@ -0,0 +1,14 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type LoginWithJWTInput = { + accountId: string + + jwt: string +} + +export const LoginWithJWTInputFromJson = (obj: any): LoginWithJWTInput => { + return { + accountId: obj['login_with_j_w_t_input_account_id'], + jwt: obj['login_with_j_w_t_input_jwt'], + } as LoginWithJWTInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTOutput.ts b/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTOutput.ts new file mode 100644 index 00000000..86afa978 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/LoginWithJWTOutput.ts @@ -0,0 +1,60 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Wallet, WalletFromJson } from '@/objects' + +export type LoginWithJWTOutput = { + accessToken: string + + wallet: Wallet + + validUntil: string +} + +export const LoginWithJWTOutputFromJson = (obj: any): LoginWithJWTOutput => { + return { + accessToken: obj['login_with_j_w_t_output_access_token'], + wallet: WalletFromJson(obj['login_with_j_w_t_output_wallet']), + validUntil: obj['login_with_j_w_t_output_valid_until'], + } as LoginWithJWTOutput +} + +export const LoginWithJWTOutputFragment = ` +fragment LoginWithJWTOutputFragment on LoginWithJWTOutput { + __typename + login_with_j_w_t_output_access_token: access_token + login_with_j_w_t_output_wallet: wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status + } + login_with_j_w_t_output_valid_until: valid_until +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Node.ts b/packages/lightspark-wallet-sdk/src/objects/Node.ts new file mode 100644 index 00000000..6995147d --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Node.ts @@ -0,0 +1,122 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException, type Query } from '@lightsparkdev/core' +import autoBind from 'auto-bind' + +import { LightsparkClient } from '@/client' +import { + BitcoinNetwork, + type Entity, + GraphNode, + NodeAddressType, + type NodeToAddressesConnection, + NodeToAddressesConnectionFromJson, +} from '@/objects' + +/** This interface represents a lightning node that can be connected to the Lightning Network to send and receive transactions. **/ +export class Node implements Entity { + constructor( + public readonly id: string, + public readonly createdAt: string, + public readonly updatedAt: string, + public readonly bitcoinNetwork: BitcoinNetwork, + public readonly displayName: string, + public readonly typename: string, + public readonly alias?: string, + public readonly color?: string, + public readonly conductivity?: number, + public readonly publicKey?: string, + ) { + autoBind(this) + } + + public async getAddresses( + client: LightsparkClient, + first: number | undefined = undefined, + types: NodeAddressType[] | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) { + entity(id: $entity_id) { + ... on Node { + addresses(, first: $first, types: $types) { + __typename + node_to_addresses_connection_count: count + node_to_addresses_connection_entities: entities { + __typename + node_address_address: address + node_address_type: type + } + } + } + } +} +`, + variables: { entity_id: this.id, first: first, types: types }, + constructObject: json => { + const connection = json['entity']['addresses'] + return NodeToAddressesConnectionFromJson(connection) + }, + }))! + } + + static getNodeQuery(id: string): Query { + return { + queryPayload: ` +query GetNode($id: ID!) { + entity(id: $id) { + ... on Node { + ...NodeFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => NodeFromJson(data.entity), + } + } +} + +export const NodeFromJson = (obj: any): Node => { + if (obj['__typename'] == 'GraphNode') { + return new GraphNode( + obj['graph_node_id'], + obj['graph_node_created_at'], + obj['graph_node_updated_at'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + BitcoinNetwork[obj['graph_node_bitcoin_network']] ?? + BitcoinNetwork.FUTURE_VALUE, + obj['graph_node_display_name'], + 'GraphNode', + obj['graph_node_alias'], + obj['graph_node_color'], + obj['graph_node_conductivity'], + obj['graph_node_public_key'], + ) + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface Node corresponding to the typename=${obj['__typename']}`, + ) +} + +const FRAGMENT = ` +fragment NodeFragment on Node { + __typename + ... on GraphNode { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/NodeAddress.ts b/packages/lightspark-wallet-sdk/src/objects/NodeAddress.ts new file mode 100644 index 00000000..4dc80b8f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/NodeAddress.ts @@ -0,0 +1,29 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { NodeAddressType } from '@/objects' + +/** An object that represents the address of a node on the Lightning Network. **/ +export type NodeAddress = { + /** The string representation of the address. **/ + address: string + + /** The type, or protocol, of this address. **/ + type: NodeAddressType +} + +export const NodeAddressFromJson = (obj: any): NodeAddress => { + return { + address: obj['node_address_address'], + type: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + NodeAddressType[obj['node_address_type']] ?? NodeAddressType.FUTURE_VALUE, + } as NodeAddress +} + +export const NodeAddressFragment = ` +fragment NodeAddressFragment on NodeAddress { + __typename + node_address_address: address + node_address_type: type +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/NodeAddressType.ts b/packages/lightspark-wallet-sdk/src/objects/NodeAddressType.ts new file mode 100644 index 00000000..cf559448 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/NodeAddressType.ts @@ -0,0 +1,16 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +/** An enum that enumerates all possible types of addresses of a node on the Lightning Network. **/ +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + + IPV4 = 'IPV4', + + IPV6 = 'IPV6', + + TOR = 'TOR', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/NodeToAddressesConnection.ts b/packages/lightspark-wallet-sdk/src/objects/NodeToAddressesConnection.ts new file mode 100644 index 00000000..1639f4f5 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/NodeToAddressesConnection.ts @@ -0,0 +1,39 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type NodeAddress, NodeAddressFromJson } from '@/objects' + +/** A connection between a node and the addresses it has announced for itself on Lightning Network. **/ +export type 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). + **/ + count: number + + /** The addresses for the current page of this connection. **/ + entities: NodeAddress[] +} + +export const NodeToAddressesConnectionFromJson = ( + obj: any, +): NodeToAddressesConnection => { + return { + count: obj['node_to_addresses_connection_count'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + entities: obj['node_to_addresses_connection_entities'].map(e => + NodeAddressFromJson(e), + ), + } as NodeToAddressesConnection +} + +export const NodeToAddressesConnectionFragment = ` +fragment NodeToAddressesConnectionFragment on NodeToAddressesConnection { + __typename + node_to_addresses_connection_count: count + node_to_addresses_connection_entities: entities { + __typename + node_address_address: address + node_address_type: type + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/OnChainTransaction.ts b/packages/lightspark-wallet-sdk/src/objects/OnChainTransaction.ts new file mode 100644 index 00000000..21b714df --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/OnChainTransaction.ts @@ -0,0 +1,312 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException, type Query } from '@lightsparkdev/core' + +import { + type ChannelClosingTransaction, + type ChannelOpeningTransaction, + type CurrencyAmount, + CurrencyAmountFromJson, + type Deposit, + type Entity, + type Transaction, + TransactionStatus, + type Withdrawal, +} from '@/objects' + +/** Transaction happened on Bitcoin blockchain. **/ +export type OnChainTransaction = Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** + * The height of the block that included this transaction. This will be zero for unconfirmed + * transactions. + **/ + blockHeight: number + + /** The Bitcoin blockchain addresses this transaction was sent to. **/ + destinationAddresses: string[] + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin + * blockchain. + **/ + fees?: CurrencyAmount + + /** + * The hash of the block that included this transaction. This will be null for unconfirmed + * transactions. + **/ + blockHash?: string + + /** The number of blockchain confirmations for this transaction in real time. **/ + numConfirmations?: number + } + +export const OnChainTransactionFromJson = (obj: any): OnChainTransaction => { + if (obj['__typename'] == 'ChannelClosingTransaction') { + return { + id: obj['channel_closing_transaction_id'], + createdAt: obj['channel_closing_transaction_created_at'], + updatedAt: obj['channel_closing_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_closing_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_closing_transaction_amount']), + blockHeight: obj['channel_closing_transaction_block_height'], + destinationAddresses: + obj['channel_closing_transaction_destination_addresses'], + typename: 'ChannelClosingTransaction', + resolvedAt: obj['channel_closing_transaction_resolved_at'], + transactionHash: obj['channel_closing_transaction_transaction_hash'], + fees: obj['channel_closing_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_closing_transaction_fees']) + : undefined, + blockHash: obj['channel_closing_transaction_block_hash'], + numConfirmations: obj['channel_closing_transaction_num_confirmations'], + } as ChannelClosingTransaction + } + if (obj['__typename'] == 'ChannelOpeningTransaction') { + return { + id: obj['channel_opening_transaction_id'], + createdAt: obj['channel_opening_transaction_created_at'], + updatedAt: obj['channel_opening_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_opening_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_opening_transaction_amount']), + blockHeight: obj['channel_opening_transaction_block_height'], + destinationAddresses: + obj['channel_opening_transaction_destination_addresses'], + typename: 'ChannelOpeningTransaction', + resolvedAt: obj['channel_opening_transaction_resolved_at'], + transactionHash: obj['channel_opening_transaction_transaction_hash'], + fees: obj['channel_opening_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_opening_transaction_fees']) + : undefined, + blockHash: obj['channel_opening_transaction_block_hash'], + numConfirmations: obj['channel_opening_transaction_num_confirmations'], + } as ChannelOpeningTransaction + } + if (obj['__typename'] == 'Deposit') { + return { + id: obj['deposit_id'], + createdAt: obj['deposit_created_at'], + updatedAt: obj['deposit_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['deposit_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['deposit_amount']), + blockHeight: obj['deposit_block_height'], + destinationAddresses: obj['deposit_destination_addresses'], + typename: 'Deposit', + resolvedAt: obj['deposit_resolved_at'], + transactionHash: obj['deposit_transaction_hash'], + fees: obj['deposit_fees'] + ? CurrencyAmountFromJson(obj['deposit_fees']) + : undefined, + blockHash: obj['deposit_block_hash'], + numConfirmations: obj['deposit_num_confirmations'], + } as Deposit + } + if (obj['__typename'] == 'Withdrawal') { + return { + id: obj['withdrawal_id'], + createdAt: obj['withdrawal_created_at'], + updatedAt: obj['withdrawal_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['withdrawal_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['withdrawal_amount']), + blockHeight: obj['withdrawal_block_height'], + destinationAddresses: obj['withdrawal_destination_addresses'], + typename: 'Withdrawal', + resolvedAt: obj['withdrawal_resolved_at'], + transactionHash: obj['withdrawal_transaction_hash'], + fees: obj['withdrawal_fees'] + ? CurrencyAmountFromJson(obj['withdrawal_fees']) + : undefined, + blockHash: obj['withdrawal_block_hash'], + numConfirmations: obj['withdrawal_num_confirmations'], + } as Withdrawal + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj['__typename']}`, + ) +} + +const FRAGMENT = ` +fragment OnChainTransactionFragment on OnChainTransaction { + __typename + ... on ChannelClosingTransaction { + __typename + channel_closing_transaction_id: id + channel_closing_transaction_created_at: created_at + channel_closing_transaction_updated_at: updated_at + channel_closing_transaction_status: status + channel_closing_transaction_resolved_at: resolved_at + channel_closing_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_transaction_hash: transaction_hash + channel_closing_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_block_hash: block_hash + channel_closing_transaction_block_height: block_height + channel_closing_transaction_destination_addresses: destination_addresses + channel_closing_transaction_num_confirmations: num_confirmations + } + ... on ChannelOpeningTransaction { + __typename + channel_opening_transaction_id: id + channel_opening_transaction_created_at: created_at + channel_opening_transaction_updated_at: updated_at + channel_opening_transaction_status: status + channel_opening_transaction_resolved_at: resolved_at + channel_opening_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_transaction_hash: transaction_hash + channel_opening_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_block_hash: block_hash + channel_opening_transaction_block_height: block_height + channel_opening_transaction_destination_addresses: destination_addresses + channel_opening_transaction_num_confirmations: num_confirmations + } + ... on Deposit { + __typename + deposit_id: id + deposit_created_at: created_at + deposit_updated_at: updated_at + deposit_status: status + deposit_resolved_at: resolved_at + deposit_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_transaction_hash: transaction_hash + deposit_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_block_hash: block_hash + deposit_block_height: block_height + deposit_destination_addresses: destination_addresses + deposit_num_confirmations: num_confirmations + } + ... on Withdrawal { + __typename + withdrawal_id: id + withdrawal_created_at: created_at + withdrawal_updated_at: updated_at + withdrawal_status: status + withdrawal_resolved_at: resolved_at + withdrawal_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_transaction_hash: transaction_hash + withdrawal_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_block_hash: block_hash + withdrawal_block_height: block_height + withdrawal_destination_addresses: destination_addresses + withdrawal_num_confirmations: num_confirmations + } +}` + +export const getOnChainTransactionQuery = ( + id: string, +): Query => { + return { + queryPayload: ` +query GetOnChainTransaction($id: ID!) { + entity(id: $id) { + ... on OnChainTransaction { + ...OnChainTransactionFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => OnChainTransactionFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/OutgoingPayment.ts b/packages/lightspark-wallet-sdk/src/objects/OutgoingPayment.ts new file mode 100644 index 00000000..17d9d270 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/OutgoingPayment.ts @@ -0,0 +1,175 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type LightningTransaction, + PaymentFailureReason, + type PaymentRequestData, + PaymentRequestDataFromJson, + type RichText, + RichTextFromJson, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** A transaction that was sent from a Lightspark node on the Lightning Network. **/ +export type OutgoingPayment = LightningTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** The fees paid by the sender node to send the payment. **/ + fees?: CurrencyAmount + + /** The data of the payment request that was paid by this transaction, if known. **/ + paymentRequestData?: PaymentRequestData + + /** If applicable, the reason why the payment failed. **/ + failureReason?: PaymentFailureReason + + /** If applicable, user-facing error message describing why the payment failed. **/ + failureMessage?: RichText + } + +export const OutgoingPaymentFromJson = (obj: any): OutgoingPayment => { + return { + id: obj['outgoing_payment_id'], + createdAt: obj['outgoing_payment_created_at'], + updatedAt: obj['outgoing_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['outgoing_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['outgoing_payment_amount']), + typename: 'OutgoingPayment', + resolvedAt: obj['outgoing_payment_resolved_at'], + transactionHash: obj['outgoing_payment_transaction_hash'], + fees: obj['outgoing_payment_fees'] + ? CurrencyAmountFromJson(obj['outgoing_payment_fees']) + : undefined, + paymentRequestData: obj['outgoing_payment_payment_request_data'] + ? PaymentRequestDataFromJson(obj['outgoing_payment_payment_request_data']) + : undefined, + failureReason: obj['outgoing_payment_failure_reason'] + ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + PaymentFailureReason[obj['outgoing_payment_failure_reason']] ?? + PaymentFailureReason.FUTURE_VALUE + : null, + failureMessage: obj['outgoing_payment_failure_message'] + ? RichTextFromJson(obj['outgoing_payment_failure_message']) + : undefined, + } as OutgoingPayment +} + +export const OutgoingPaymentFragment = ` +fragment OutgoingPaymentFragment on OutgoingPayment { + __typename + outgoing_payment_id: id + outgoing_payment_created_at: created_at + outgoing_payment_updated_at: updated_at + outgoing_payment_status: status + outgoing_payment_resolved_at: resolved_at + outgoing_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_transaction_hash: transaction_hash + outgoing_payment_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_payment_request_data: payment_request_data { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + } + outgoing_payment_failure_reason: failure_reason + outgoing_payment_failure_message: failure_message { + __typename + rich_text_text: text + } +}` + +export const getOutgoingPaymentQuery = (id: string): Query => { + return { + queryPayload: ` +query GetOutgoingPayment($id: ID!) { + entity(id: $id) { + ... on OutgoingPayment { + ...OutgoingPaymentFragment + } + } +} + +${OutgoingPaymentFragment} +`, + variables: { id }, + constructObject: (data: any) => OutgoingPaymentFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/PageInfo.ts b/packages/lightspark-wallet-sdk/src/objects/PageInfo.ts new file mode 100644 index 00000000..d80b7011 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PageInfo.ts @@ -0,0 +1,29 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type PageInfo = { + hasNextPage?: boolean + + hasPreviousPage?: boolean + + startCursor?: string + + endCursor?: string +} + +export const PageInfoFromJson = (obj: any): PageInfo => { + return { + hasNextPage: obj['page_info_has_next_page'], + hasPreviousPage: obj['page_info_has_previous_page'], + startCursor: obj['page_info_start_cursor'], + endCursor: obj['page_info_end_cursor'], + } as PageInfo +} + +export const PageInfoFragment = ` +fragment PageInfoFragment on PageInfo { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/PayInvoiceInput.ts b/packages/lightspark-wallet-sdk/src/objects/PayInvoiceInput.ts new file mode 100644 index 00000000..3b4c4d0c --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PayInvoiceInput.ts @@ -0,0 +1,27 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type PayInvoiceInput = { + /** The invoice you want to pay (as defined by the BOLT11 standard). **/ + encodedInvoice: string + + /** 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. **/ + maximumFeesMsats: number + + /** + * The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the + * invoice amount is zero. + **/ + amountMsats?: number +} + +export const PayInvoiceInputFromJson = (obj: any): PayInvoiceInput => { + return { + encodedInvoice: obj['pay_invoice_input_encoded_invoice'], + timeoutSecs: obj['pay_invoice_input_timeout_secs'], + maximumFeesMsats: obj['pay_invoice_input_maximum_fees_msats'], + amountMsats: obj['pay_invoice_input_amount_msats'], + } as PayInvoiceInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/PayInvoiceOutput.ts b/packages/lightspark-wallet-sdk/src/objects/PayInvoiceOutput.ts new file mode 100644 index 00000000..194e6436 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PayInvoiceOutput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type PayInvoiceOutput = { + /** The payment that has been sent. **/ + paymentId: string +} + +export const PayInvoiceOutputFromJson = (obj: any): PayInvoiceOutput => { + return { + paymentId: obj['pay_invoice_output_payment'].id, + } as PayInvoiceOutput +} + +export const PayInvoiceOutputFragment = ` +fragment PayInvoiceOutputFragment on PayInvoiceOutput { + __typename + pay_invoice_output_payment: payment { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/PaymentFailureReason.ts b/packages/lightspark-wallet-sdk/src/objects/PaymentFailureReason.ts new file mode 100644 index 00000000..d43d3b9d --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PaymentFailureReason.ts @@ -0,0 +1,29 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + + NONE = 'NONE', + + TIMEOUT = 'TIMEOUT', + + NO_ROUTE = 'NO_ROUTE', + + ERROR = 'ERROR', + + INCORRECT_PAYMENT_DETAILS = 'INCORRECT_PAYMENT_DETAILS', + + INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE', + + INVOICE_ALREADY_PAID = 'INVOICE_ALREADY_PAID', + + SELF_PAYMENT = 'SELF_PAYMENT', + + INVOICE_EXPIRED = 'INVOICE_EXPIRED', + + RISK_SCREENING_FAILED = 'RISK_SCREENING_FAILED', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/PaymentRequest.ts b/packages/lightspark-wallet-sdk/src/objects/PaymentRequest.ts new file mode 100644 index 00000000..5389e8b5 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PaymentRequest.ts @@ -0,0 +1,126 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException, type Query } from '@lightsparkdev/core' + +import { + CurrencyAmountFromJson, + type Entity, + type Invoice, + InvoiceDataFromJson, + type PaymentRequestData, + PaymentRequestStatus, +} from '@/objects' + +export type PaymentRequest = Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when the entity was first created. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The details of the payment request. **/ + data: PaymentRequestData + + /** The status of the payment request. **/ + status: PaymentRequestStatus + + /** The typename of the object **/ + typename: string +} + +export const PaymentRequestFromJson = (obj: any): PaymentRequest => { + if (obj['__typename'] == 'Invoice') { + return { + id: obj['invoice_id'], + createdAt: obj['invoice_created_at'], + updatedAt: obj['invoice_updated_at'], + data: InvoiceDataFromJson(obj['invoice_data']), + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + PaymentRequestStatus[obj['invoice_status']] ?? + PaymentRequestStatus.FUTURE_VALUE, + typename: 'Invoice', + amountPaid: obj['invoice_amount_paid'] + ? CurrencyAmountFromJson(obj['invoice_amount_paid']) + : undefined, + } as Invoice + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface PaymentRequest corresponding to the typename=${obj['__typename']}`, + ) +} + +export const PaymentRequestFragment = ` +fragment PaymentRequestFragment on PaymentRequest { + __typename + ... on Invoice { + __typename + invoice_id: id + invoice_created_at: created_at + invoice_updated_at: updated_at + invoice_data: data { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + invoice_status: status + invoice_amount_paid: amount_paid { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } +}` + +export const getPaymentRequestQuery = (id: string): Query => { + return { + queryPayload: ` +query GetPaymentRequest($id: ID!) { + entity(id: $id) { + ... on PaymentRequest { + ...PaymentRequestFragment + } + } +} + +${PaymentRequestFragment} +`, + variables: { id }, + constructObject: (data: any) => PaymentRequestFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/PaymentRequestData.ts b/packages/lightspark-wallet-sdk/src/objects/PaymentRequestData.ts new file mode 100644 index 00000000..732ec3c5 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PaymentRequestData.ts @@ -0,0 +1,78 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException } from '@lightsparkdev/core' + +import { + BitcoinNetwork, + CurrencyAmountFromJson, + GraphNodeFromJson, + type InvoiceData, +} from '@/objects' + +/** The interface of a payment request on the Lightning Network (a.k.a. Lightning Invoice). **/ +export type PaymentRequestData = { + encodedPaymentRequest: string + + bitcoinNetwork: BitcoinNetwork + + /** The typename of the object **/ + typename: string +} + +export const PaymentRequestDataFromJson = (obj: any): PaymentRequestData => { + if (obj['__typename'] == 'InvoiceData') { + return { + encodedPaymentRequest: obj['invoice_data_encoded_payment_request'], + bitcoinNetwork: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + BitcoinNetwork[obj['invoice_data_bitcoin_network']] ?? + BitcoinNetwork.FUTURE_VALUE, + paymentHash: obj['invoice_data_payment_hash'], + amount: CurrencyAmountFromJson(obj['invoice_data_amount']), + createdAt: obj['invoice_data_created_at'], + expiresAt: obj['invoice_data_expires_at'], + destination: GraphNodeFromJson(obj['invoice_data_destination']), + typename: 'InvoiceData', + memo: obj['invoice_data_memo'], + } as InvoiceData + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface PaymentRequestData corresponding to the typename=${obj['__typename']}`, + ) +} + +export const PaymentRequestDataFragment = ` +fragment PaymentRequestDataFragment on PaymentRequestData { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/PaymentRequestStatus.ts b/packages/lightspark-wallet-sdk/src/objects/PaymentRequestStatus.ts new file mode 100644 index 00000000..7ba89414 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/PaymentRequestStatus.ts @@ -0,0 +1,13 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + + OPEN = 'OPEN', + + CLOSED = 'CLOSED', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalInput.ts b/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalInput.ts new file mode 100644 index 00000000..fc86c293 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalInput.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type RequestWithdrawalInput = { + /** The bitcoin address where the withdrawal should be sent. **/ + 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. + **/ + amountSats: number +} + +export const RequestWithdrawalInputFromJson = ( + obj: any, +): RequestWithdrawalInput => { + return { + bitcoinAddress: obj['request_withdrawal_input_bitcoin_address'], + amountSats: obj['request_withdrawal_input_amount_sats'], + } as RequestWithdrawalInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalOutput.ts b/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalOutput.ts new file mode 100644 index 00000000..cf228ad7 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/RequestWithdrawalOutput.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type RequestWithdrawalOutput = { + /** The request that is created for this withdrawal. **/ + requestId: string +} + +export const RequestWithdrawalOutputFromJson = ( + obj: any, +): RequestWithdrawalOutput => { + return { + requestId: obj['request_withdrawal_output_request'].id, + } as RequestWithdrawalOutput +} + +export const RequestWithdrawalOutputFragment = ` +fragment RequestWithdrawalOutputFragment on RequestWithdrawalOutput { + __typename + request_withdrawal_output_request: request { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/RichText.ts b/packages/lightspark-wallet-sdk/src/objects/RichText.ts new file mode 100644 index 00000000..af1e57e0 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/RichText.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type RichText = { + text: string +} + +export const RichTextFromJson = (obj: any): RichText => { + return { + text: obj['rich_text_text'], + } as RichText +} + +export const RichTextFragment = ` +fragment RichTextFragment on RichText { + __typename + rich_text_text: text +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/SendPaymentInput.ts b/packages/lightspark-wallet-sdk/src/objects/SendPaymentInput.ts new file mode 100644 index 00000000..261fc368 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/SendPaymentInput.ts @@ -0,0 +1,24 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type SendPaymentInput = { + /** The public key of the destination node. **/ + destinationPublicKey: string + + /** The timeout in seconds that we will try to make the payment. **/ + timeoutSecs: number + + /** 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. **/ + maximumFeesMsats: number +} + +export const SendPaymentInputFromJson = (obj: any): SendPaymentInput => { + return { + destinationPublicKey: obj['send_payment_input_destination_public_key'], + timeoutSecs: obj['send_payment_input_timeout_secs'], + amountMsats: obj['send_payment_input_amount_msats'], + maximumFeesMsats: obj['send_payment_input_maximum_fees_msats'], + } as SendPaymentInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/SendPaymentOutput.ts b/packages/lightspark-wallet-sdk/src/objects/SendPaymentOutput.ts new file mode 100644 index 00000000..9591a831 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/SendPaymentOutput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type SendPaymentOutput = { + /** The payment that has been sent. **/ + paymentId: string +} + +export const SendPaymentOutputFromJson = (obj: any): SendPaymentOutput => { + return { + paymentId: obj['send_payment_output_payment'].id, + } as SendPaymentOutput +} + +export const SendPaymentOutputFragment = ` +fragment SendPaymentOutputFragment on SendPaymentOutput { + __typename + send_payment_output_payment: payment { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/TerminateWalletOutput.ts b/packages/lightspark-wallet-sdk/src/objects/TerminateWalletOutput.ts new file mode 100644 index 00000000..2e3dbff1 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/TerminateWalletOutput.ts @@ -0,0 +1,54 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { Wallet, WalletFromJson } from '@/objects' + +export type TerminateWalletOutput = { + wallet: Wallet +} + +export const TerminateWalletOutputFromJson = ( + obj: any, +): TerminateWalletOutput => { + return { + wallet: WalletFromJson(obj['terminate_wallet_output_wallet']), + } as TerminateWalletOutput +} + +export const TerminateWalletOutputFragment = ` +fragment TerminateWalletOutputFragment on TerminateWalletOutput { + __typename + terminate_wallet_output_wallet: wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Transaction.ts b/packages/lightspark-wallet-sdk/src/objects/Transaction.ts new file mode 100644 index 00000000..28e0e07c --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Transaction.ts @@ -0,0 +1,421 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { LightsparkException, type Query } from '@lightsparkdev/core' + +import { + type ChannelClosingTransaction, + type ChannelOpeningTransaction, + type CurrencyAmount, + CurrencyAmountFromJson, + type Deposit, + type Entity, + type IncomingPayment, + type OutgoingPayment, + PaymentFailureReason, + PaymentRequestDataFromJson, + RichTextFromJson, + TransactionStatus, + type Withdrawal, +} from '@/objects' + +export type Transaction = Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string +} + +export const TransactionFromJson = (obj: any): Transaction => { + if (obj['__typename'] == 'ChannelClosingTransaction') { + return { + id: obj['channel_closing_transaction_id'], + createdAt: obj['channel_closing_transaction_created_at'], + updatedAt: obj['channel_closing_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_closing_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_closing_transaction_amount']), + blockHeight: obj['channel_closing_transaction_block_height'], + destinationAddresses: + obj['channel_closing_transaction_destination_addresses'], + typename: 'ChannelClosingTransaction', + resolvedAt: obj['channel_closing_transaction_resolved_at'], + transactionHash: obj['channel_closing_transaction_transaction_hash'], + fees: obj['channel_closing_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_closing_transaction_fees']) + : undefined, + blockHash: obj['channel_closing_transaction_block_hash'], + numConfirmations: obj['channel_closing_transaction_num_confirmations'], + } as ChannelClosingTransaction + } + if (obj['__typename'] == 'ChannelOpeningTransaction') { + return { + id: obj['channel_opening_transaction_id'], + createdAt: obj['channel_opening_transaction_created_at'], + updatedAt: obj['channel_opening_transaction_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['channel_opening_transaction_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['channel_opening_transaction_amount']), + blockHeight: obj['channel_opening_transaction_block_height'], + destinationAddresses: + obj['channel_opening_transaction_destination_addresses'], + typename: 'ChannelOpeningTransaction', + resolvedAt: obj['channel_opening_transaction_resolved_at'], + transactionHash: obj['channel_opening_transaction_transaction_hash'], + fees: obj['channel_opening_transaction_fees'] + ? CurrencyAmountFromJson(obj['channel_opening_transaction_fees']) + : undefined, + blockHash: obj['channel_opening_transaction_block_hash'], + numConfirmations: obj['channel_opening_transaction_num_confirmations'], + } as ChannelOpeningTransaction + } + if (obj['__typename'] == 'Deposit') { + return { + id: obj['deposit_id'], + createdAt: obj['deposit_created_at'], + updatedAt: obj['deposit_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['deposit_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['deposit_amount']), + blockHeight: obj['deposit_block_height'], + destinationAddresses: obj['deposit_destination_addresses'], + typename: 'Deposit', + resolvedAt: obj['deposit_resolved_at'], + transactionHash: obj['deposit_transaction_hash'], + fees: obj['deposit_fees'] + ? CurrencyAmountFromJson(obj['deposit_fees']) + : undefined, + blockHash: obj['deposit_block_hash'], + numConfirmations: obj['deposit_num_confirmations'], + } as Deposit + } + if (obj['__typename'] == 'IncomingPayment') { + return { + id: obj['incoming_payment_id'], + createdAt: obj['incoming_payment_created_at'], + updatedAt: obj['incoming_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['incoming_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['incoming_payment_amount']), + typename: 'IncomingPayment', + resolvedAt: obj['incoming_payment_resolved_at'], + transactionHash: obj['incoming_payment_transaction_hash'], + paymentRequestId: + obj['incoming_payment_payment_request']?.id ?? undefined, + } as IncomingPayment + } + if (obj['__typename'] == 'OutgoingPayment') { + return { + id: obj['outgoing_payment_id'], + createdAt: obj['outgoing_payment_created_at'], + updatedAt: obj['outgoing_payment_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['outgoing_payment_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['outgoing_payment_amount']), + typename: 'OutgoingPayment', + resolvedAt: obj['outgoing_payment_resolved_at'], + transactionHash: obj['outgoing_payment_transaction_hash'], + fees: obj['outgoing_payment_fees'] + ? CurrencyAmountFromJson(obj['outgoing_payment_fees']) + : undefined, + paymentRequestData: obj['outgoing_payment_payment_request_data'] + ? PaymentRequestDataFromJson( + obj['outgoing_payment_payment_request_data'], + ) + : undefined, + failureReason: obj['outgoing_payment_failure_reason'] + ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + PaymentFailureReason[obj['outgoing_payment_failure_reason']] ?? + PaymentFailureReason.FUTURE_VALUE + : null, + failureMessage: obj['outgoing_payment_failure_message'] + ? RichTextFromJson(obj['outgoing_payment_failure_message']) + : undefined, + } as OutgoingPayment + } + if (obj['__typename'] == 'Withdrawal') { + return { + id: obj['withdrawal_id'], + createdAt: obj['withdrawal_created_at'], + updatedAt: obj['withdrawal_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['withdrawal_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['withdrawal_amount']), + blockHeight: obj['withdrawal_block_height'], + destinationAddresses: obj['withdrawal_destination_addresses'], + typename: 'Withdrawal', + resolvedAt: obj['withdrawal_resolved_at'], + transactionHash: obj['withdrawal_transaction_hash'], + fees: obj['withdrawal_fees'] + ? CurrencyAmountFromJson(obj['withdrawal_fees']) + : undefined, + blockHash: obj['withdrawal_block_hash'], + numConfirmations: obj['withdrawal_num_confirmations'], + } as Withdrawal + } + throw new LightsparkException( + 'DeserializationError', + `Couldn't find a concrete type for interface Transaction corresponding to the typename=${obj['__typename']}`, + ) +} + +export const TransactionFragment = ` +fragment TransactionFragment on Transaction { + __typename + ... on ChannelClosingTransaction { + __typename + channel_closing_transaction_id: id + channel_closing_transaction_created_at: created_at + channel_closing_transaction_updated_at: updated_at + channel_closing_transaction_status: status + channel_closing_transaction_resolved_at: resolved_at + channel_closing_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_transaction_hash: transaction_hash + channel_closing_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_block_hash: block_hash + channel_closing_transaction_block_height: block_height + channel_closing_transaction_destination_addresses: destination_addresses + channel_closing_transaction_num_confirmations: num_confirmations + } + ... on ChannelOpeningTransaction { + __typename + channel_opening_transaction_id: id + channel_opening_transaction_created_at: created_at + channel_opening_transaction_updated_at: updated_at + channel_opening_transaction_status: status + channel_opening_transaction_resolved_at: resolved_at + channel_opening_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_transaction_hash: transaction_hash + channel_opening_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_block_hash: block_hash + channel_opening_transaction_block_height: block_height + channel_opening_transaction_destination_addresses: destination_addresses + channel_opening_transaction_num_confirmations: num_confirmations + } + ... on Deposit { + __typename + deposit_id: id + deposit_created_at: created_at + deposit_updated_at: updated_at + deposit_status: status + deposit_resolved_at: resolved_at + deposit_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_transaction_hash: transaction_hash + deposit_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_block_hash: block_hash + deposit_block_height: block_height + deposit_destination_addresses: destination_addresses + deposit_num_confirmations: num_confirmations + } + ... on IncomingPayment { + __typename + incoming_payment_id: id + incoming_payment_created_at: created_at + incoming_payment_updated_at: updated_at + incoming_payment_status: status + incoming_payment_resolved_at: resolved_at + incoming_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + incoming_payment_transaction_hash: transaction_hash + incoming_payment_payment_request: payment_request { + id + } + } + ... on OutgoingPayment { + __typename + outgoing_payment_id: id + outgoing_payment_created_at: created_at + outgoing_payment_updated_at: updated_at + outgoing_payment_status: status + outgoing_payment_resolved_at: resolved_at + outgoing_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_transaction_hash: transaction_hash + outgoing_payment_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_payment_request_data: payment_request_data { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + } + outgoing_payment_failure_reason: failure_reason + outgoing_payment_failure_message: failure_message { + __typename + rich_text_text: text + } + } + ... on Withdrawal { + __typename + withdrawal_id: id + withdrawal_created_at: created_at + withdrawal_updated_at: updated_at + withdrawal_status: status + withdrawal_resolved_at: resolved_at + withdrawal_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_transaction_hash: transaction_hash + withdrawal_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_block_hash: block_hash + withdrawal_block_height: block_height + withdrawal_destination_addresses: destination_addresses + withdrawal_num_confirmations: num_confirmations + } +}` + +export const getTransactionQuery = (id: string): Query => { + return { + queryPayload: ` +query GetTransaction($id: ID!) { + entity(id: $id) { + ... on Transaction { + ...TransactionFragment + } + } +} + +${TransactionFragment} +`, + variables: { id }, + constructObject: (data: any) => TransactionFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/TransactionStatus.ts b/packages/lightspark-wallet-sdk/src/objects/TransactionStatus.ts new file mode 100644 index 00000000..7f735b8f --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/TransactionStatus.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + /** Transaction succeeded.. **/ + SUCCESS = 'SUCCESS', + /** Transaction failed. **/ + 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. **/ + NOT_STARTED = 'NOT_STARTED', + /** 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-wallet-sdk/src/objects/TransactionType.ts b/packages/lightspark-wallet-sdk/src/objects/TransactionType.ts new file mode 100644 index 00000000..9c13296a --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/TransactionType.ts @@ -0,0 +1,29 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + 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. **/ + ROUTED = 'ROUTED', + /** 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. **/ + 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. **/ + 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. **/ + ROUTE = 'ROUTE', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitInput.ts b/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitInput.ts new file mode 100644 index 00000000..bf071ce6 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitInput.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export type UpdateFundsRecoveryKitInput = { + s3BucketUrl: string + + bitcoinWalletAddress: string +} + +export const UpdateFundsRecoveryKitInputFromJson = ( + obj: any, +): UpdateFundsRecoveryKitInput => { + return { + s3BucketUrl: obj['update_funds_recovery_kit_input_s3_bucket_url'], + bitcoinWalletAddress: + obj['update_funds_recovery_kit_input_bitcoin_wallet_address'], + } as UpdateFundsRecoveryKitInput +} diff --git a/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitOutput.ts b/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitOutput.ts new file mode 100644 index 00000000..26ed00dc --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/UpdateFundsRecoveryKitOutput.ts @@ -0,0 +1,36 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type FundsRecoveryKit, FundsRecoveryKitFromJson } from '@/objects' + +export type UpdateFundsRecoveryKitOutput = { + walletId: string + + fundsRecoveryKit: FundsRecoveryKit +} + +export const UpdateFundsRecoveryKitOutputFromJson = ( + obj: any, +): UpdateFundsRecoveryKitOutput => { + return { + walletId: obj['update_funds_recovery_kit_output_wallet'].id, + fundsRecoveryKit: FundsRecoveryKitFromJson( + obj['update_funds_recovery_kit_output_funds_recovery_kit'], + ), + } as UpdateFundsRecoveryKitOutput +} + +export const UpdateFundsRecoveryKitOutputFragment = ` +fragment UpdateFundsRecoveryKitOutputFragment on UpdateFundsRecoveryKitOutput { + __typename + update_funds_recovery_kit_output_wallet: wallet { + id + } + update_funds_recovery_kit_output_funds_recovery_kit: funds_recovery_kit { + __typename + ... on AmazonS3FundsRecoveryKit { + __typename + amazon_s3_funds_recovery_kit_bitcoin_wallet_address: bitcoin_wallet_address + amazon_s3_funds_recovery_kit_s3_bucket_url: s3_bucket_url + } + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Wallet.ts b/packages/lightspark-wallet-sdk/src/objects/Wallet.ts new file mode 100644 index 00000000..e3f376d4 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Wallet.ts @@ -0,0 +1,432 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from '@lightsparkdev/core' +import autoBind from 'auto-bind' + +import { LightsparkClient } from '@/client' +import { + type Balances, + BalancesFromJson, + type Entity, + TransactionStatus, + TransactionType, + WalletStatus, + type WalletToPaymentRequestsConnection, + WalletToPaymentRequestsConnectionFromJson, + type WalletToTransactionsConnection, + WalletToTransactionsConnectionFromJson, +} from '@/objects' + +export class Wallet implements Entity { + constructor( + public readonly id: string, + public readonly createdAt: string, + public readonly updatedAt: string, + public readonly status: WalletStatus, + public readonly typename: string, + public readonly balances?: Balances, + ) { + autoBind(this) + } + + public async getTransactions( + client: LightsparkClient, + first: number | undefined = undefined, + after: string | undefined = undefined, + createdAfterDate: string | undefined = undefined, + createdBeforeDate: string | undefined = undefined, + statuses: TransactionStatus[] | undefined = undefined, + types: TransactionType[] | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchWalletToTransactionsConnection($first: Int, $after: ID, $created_after_date: DateTime, $created_before_date: DateTime, $statuses: [TransactionStatus!], $types: [TransactionType!]) { + current_wallet { + ... on Wallet { + transactions(, first: $first, after: $after, created_after_date: $created_after_date, created_before_date: $created_before_date, statuses: $statuses, types: $types) { + __typename + wallet_to_transactions_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + wallet_to_transactions_connection_count: count + wallet_to_transactions_connection_entities: entities { + __typename + ... on ChannelClosingTransaction { + __typename + channel_closing_transaction_id: id + channel_closing_transaction_created_at: created_at + channel_closing_transaction_updated_at: updated_at + channel_closing_transaction_status: status + channel_closing_transaction_resolved_at: resolved_at + channel_closing_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_transaction_hash: transaction_hash + channel_closing_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_closing_transaction_block_hash: block_hash + channel_closing_transaction_block_height: block_height + channel_closing_transaction_destination_addresses: destination_addresses + channel_closing_transaction_num_confirmations: num_confirmations + } + ... on ChannelOpeningTransaction { + __typename + channel_opening_transaction_id: id + channel_opening_transaction_created_at: created_at + channel_opening_transaction_updated_at: updated_at + channel_opening_transaction_status: status + channel_opening_transaction_resolved_at: resolved_at + channel_opening_transaction_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_transaction_hash: transaction_hash + channel_opening_transaction_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_opening_transaction_block_hash: block_hash + channel_opening_transaction_block_height: block_height + channel_opening_transaction_destination_addresses: destination_addresses + channel_opening_transaction_num_confirmations: num_confirmations + } + ... on Deposit { + __typename + deposit_id: id + deposit_created_at: created_at + deposit_updated_at: updated_at + deposit_status: status + deposit_resolved_at: resolved_at + deposit_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_transaction_hash: transaction_hash + deposit_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + deposit_block_hash: block_hash + deposit_block_height: block_height + deposit_destination_addresses: destination_addresses + deposit_num_confirmations: num_confirmations + } + ... on IncomingPayment { + __typename + incoming_payment_id: id + incoming_payment_created_at: created_at + incoming_payment_updated_at: updated_at + incoming_payment_status: status + incoming_payment_resolved_at: resolved_at + incoming_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + incoming_payment_transaction_hash: transaction_hash + incoming_payment_payment_request: payment_request { + id + } + } + ... on OutgoingPayment { + __typename + outgoing_payment_id: id + outgoing_payment_created_at: created_at + outgoing_payment_updated_at: updated_at + outgoing_payment_status: status + outgoing_payment_resolved_at: resolved_at + outgoing_payment_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_transaction_hash: transaction_hash + outgoing_payment_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + outgoing_payment_payment_request_data: payment_request_data { + __typename + ... on InvoiceData { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + } + outgoing_payment_failure_reason: failure_reason + outgoing_payment_failure_message: failure_message { + __typename + rich_text_text: text + } + } + ... on Withdrawal { + __typename + withdrawal_id: id + withdrawal_created_at: created_at + withdrawal_updated_at: updated_at + withdrawal_status: status + withdrawal_resolved_at: resolved_at + withdrawal_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_transaction_hash: transaction_hash + withdrawal_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_block_hash: block_hash + withdrawal_block_height: block_height + withdrawal_destination_addresses: destination_addresses + withdrawal_num_confirmations: num_confirmations + } + } + } + } + } +} +`, + variables: { + first: first, + after: after, + created_after_date: createdAfterDate, + created_before_date: createdBeforeDate, + statuses: statuses, + types: types, + }, + constructObject: json => { + const connection = json['current_wallet']['transactions'] + return WalletToTransactionsConnectionFromJson(connection) + }, + }))! + } + + public async getPaymentRequests( + client: LightsparkClient, + first: number | undefined = undefined, + after: string | undefined = undefined, + createdAfterDate: string | undefined = undefined, + createdBeforeDate: string | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchWalletToPaymentRequestsConnection($first: Int, $after: ID, $created_after_date: DateTime, $created_before_date: DateTime) { + current_wallet { + ... on Wallet { + payment_requests(, first: $first, after: $after, created_after_date: $created_after_date, created_before_date: $created_before_date) { + __typename + wallet_to_payment_requests_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + wallet_to_payment_requests_connection_count: count + wallet_to_payment_requests_connection_entities: entities { + __typename + ... on Invoice { + __typename + invoice_id: id + invoice_created_at: created_at + invoice_updated_at: updated_at + invoice_data: data { + __typename + invoice_data_encoded_payment_request: encoded_payment_request + invoice_data_bitcoin_network: bitcoin_network + invoice_data_payment_hash: payment_hash + invoice_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + invoice_data_created_at: created_at + invoice_data_expires_at: expires_at + invoice_data_memo: memo + invoice_data_destination: destination { + __typename + graph_node_id: id + graph_node_created_at: created_at + graph_node_updated_at: updated_at + graph_node_alias: alias + graph_node_bitcoin_network: bitcoin_network + graph_node_color: color + graph_node_conductivity: conductivity + graph_node_display_name: display_name + graph_node_public_key: public_key + } + } + invoice_status: status + invoice_amount_paid: amount_paid { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + } + } + } + } +} +`, + variables: { + first: first, + after: after, + created_after_date: createdAfterDate, + created_before_date: createdBeforeDate, + }, + constructObject: json => { + const connection = json['current_wallet']['payment_requests'] + return WalletToPaymentRequestsConnectionFromJson(connection) + }, + }))! + } + + static getWalletQuery(): Query { + return { + queryPayload: ` +query GetWallet { + current_wallet { + ... on Wallet { + ...WalletFragment + } + } +} + +${WalletFragment} +`, + variables: {}, + constructObject: (data: any) => WalletFromJson(data.current_wallet), + } + } +} + +export const WalletFromJson = (obj: any): Wallet => { + return new Wallet( + obj['wallet_id'], + obj['wallet_created_at'], + obj['wallet_updated_at'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + WalletStatus[obj['wallet_status']] ?? WalletStatus.FUTURE_VALUE, + 'Wallet', + obj['wallet_balances'] + ? BalancesFromJson(obj['wallet_balances']) + : undefined, + ) +} + +export const WalletFragment = ` +fragment WalletFragment on Wallet { + __typename + wallet_id: id + wallet_created_at: created_at + wallet_updated_at: updated_at + wallet_balances: balances { + __typename + balances_owned_balance: owned_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_send_balance: available_to_send_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + balances_available_to_withdraw_balance: available_to_withdraw_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + wallet_status: status +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/WalletDashboard.ts b/packages/lightspark-wallet-sdk/src/objects/WalletDashboard.ts new file mode 100644 index 00000000..34e009cd --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WalletDashboard.ts @@ -0,0 +1,16 @@ +import { type Maybe } from '@lightsparkdev/core' + +import { + type Balances, + WalletStatus, + type WalletToPaymentRequestsConnection, + type WalletToTransactionsConnection, +} from '@/objects' + +export type WalletDashboard = { + id: string + status: WalletStatus + balances: Maybe + recentTransactions: WalletToTransactionsConnection + paymentRequests: WalletToPaymentRequestsConnection +} diff --git a/packages/lightspark-wallet-sdk/src/objects/WalletStatus.ts b/packages/lightspark-wallet-sdk/src/objects/WalletStatus.ts new file mode 100644 index 00000000..016310c6 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WalletStatus.ts @@ -0,0 +1,27 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + 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. **/ + NOT_SETUP = 'NOT_SETUP', + /** 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. **/ + 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. **/ + UNAVAILABLE = 'UNAVAILABLE', + /** 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. **/ + TERMINATED = 'TERMINATED', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/WalletToPaymentRequestsConnection.ts b/packages/lightspark-wallet-sdk/src/objects/WalletToPaymentRequestsConnection.ts new file mode 100644 index 00000000..5f2ac001 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WalletToPaymentRequestsConnection.ts @@ -0,0 +1,54 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { + type PageInfo, + PageInfoFromJson, + type PaymentRequest, + PaymentRequestFromJson, +} from '@/objects' + +export type WalletToPaymentRequestsConnection = { + /** 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). + **/ + count: number + + /** The payment requests for the current page of this connection. **/ + entities: PaymentRequest[] +} + +export const WalletToPaymentRequestsConnectionFromJson = ( + obj: any, +): WalletToPaymentRequestsConnection => { + return { + pageInfo: PageInfoFromJson( + obj['wallet_to_payment_requests_connection_page_info'], + ), + count: obj['wallet_to_payment_requests_connection_count'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + entities: obj['wallet_to_payment_requests_connection_entities'].map(e => + PaymentRequestFromJson(e), + ), + } as WalletToPaymentRequestsConnection +} + +export const WalletToPaymentRequestsConnectionFragment = ` +fragment WalletToPaymentRequestsConnectionFragment on WalletToPaymentRequestsConnection { + __typename + wallet_to_payment_requests_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + wallet_to_payment_requests_connection_count: count + wallet_to_payment_requests_connection_entities: entities { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/WalletToTransactionsConnection.ts b/packages/lightspark-wallet-sdk/src/objects/WalletToTransactionsConnection.ts new file mode 100644 index 00000000..186dd608 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WalletToTransactionsConnection.ts @@ -0,0 +1,54 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { + type PageInfo, + PageInfoFromJson, + type Transaction, + TransactionFromJson, +} from '@/objects' + +export type WalletToTransactionsConnection = { + /** 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). + **/ + count: number + + /** The transactions for the current page of this connection. **/ + entities: Transaction[] +} + +export const WalletToTransactionsConnectionFromJson = ( + obj: any, +): WalletToTransactionsConnection => { + return { + pageInfo: PageInfoFromJson( + obj['wallet_to_transactions_connection_page_info'], + ), + count: obj['wallet_to_transactions_connection_count'], + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + entities: obj['wallet_to_transactions_connection_entities'].map(e => + TransactionFromJson(e), + ), + } as WalletToTransactionsConnection +} + +export const WalletToTransactionsConnectionFragment = ` +fragment WalletToTransactionsConnectionFragment on WalletToTransactionsConnection { + __typename + wallet_to_transactions_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + wallet_to_transactions_connection_count: count + wallet_to_transactions_connection_entities: entities { + id + } +}` diff --git a/packages/lightspark-wallet-sdk/src/objects/Withdrawal.ts b/packages/lightspark-wallet-sdk/src/objects/Withdrawal.ts new file mode 100644 index 00000000..989b2456 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/Withdrawal.ts @@ -0,0 +1,141 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + type OnChainTransaction, + type Transaction, + TransactionStatus, +} from '@/objects' + +/** The transaction on the Bitcoin blockchain to withdraw funds from the Lightspark node to a Bitcoin wallet. **/ +export type Withdrawal = OnChainTransaction & + Transaction & + Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when this transaction was initiated. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The current status of this transaction. **/ + status: TransactionStatus + + /** The amount of money involved in this transaction. **/ + amount: CurrencyAmount + + /** + * The height of the block that included this transaction. This will be zero for unconfirmed + * transactions. + **/ + blockHeight: number + + /** The Bitcoin blockchain addresses this transaction was sent to. **/ + destinationAddresses: string[] + + /** The typename of the object **/ + typename: string + + /** 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. **/ + transactionHash?: string + + /** + * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin + * blockchain. + **/ + fees?: CurrencyAmount + + /** + * The hash of the block that included this transaction. This will be null for unconfirmed + * transactions. + **/ + blockHash?: string + + /** The number of blockchain confirmations for this transaction in real time. **/ + numConfirmations?: number + } + +export const WithdrawalFromJson = (obj: any): Withdrawal => { + return { + id: obj['withdrawal_id'], + createdAt: obj['withdrawal_created_at'], + updatedAt: obj['withdrawal_updated_at'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + TransactionStatus[obj['withdrawal_status']] ?? + TransactionStatus.FUTURE_VALUE, + amount: CurrencyAmountFromJson(obj['withdrawal_amount']), + blockHeight: obj['withdrawal_block_height'], + destinationAddresses: obj['withdrawal_destination_addresses'], + typename: 'Withdrawal', + resolvedAt: obj['withdrawal_resolved_at'], + transactionHash: obj['withdrawal_transaction_hash'], + fees: obj['withdrawal_fees'] + ? CurrencyAmountFromJson(obj['withdrawal_fees']) + : undefined, + blockHash: obj['withdrawal_block_hash'], + numConfirmations: obj['withdrawal_num_confirmations'], + } as Withdrawal +} + +const FRAGMENT = ` +fragment WithdrawalFragment on Withdrawal { + __typename + withdrawal_id: id + withdrawal_created_at: created_at + withdrawal_updated_at: updated_at + withdrawal_status: status + withdrawal_resolved_at: resolved_at + withdrawal_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_transaction_hash: transaction_hash + withdrawal_fees: fees { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_block_hash: block_hash + withdrawal_block_height: block_height + withdrawal_destination_addresses: destination_addresses + withdrawal_num_confirmations: num_confirmations +}` + +export const getWithdrawalQuery = (id: string): Query => { + return { + queryPayload: ` +query GetWithdrawal($id: ID!) { + entity(id: $id) { + ... on Withdrawal { + ...WithdrawalFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => WithdrawalFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequest.ts b/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequest.ts new file mode 100644 index 00000000..5b85aab6 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequest.ts @@ -0,0 +1,119 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from '@lightsparkdev/core' + +import { + type CurrencyAmount, + CurrencyAmountFromJson, + type Entity, + WithdrawalRequestStatus, +} from '@/objects' + +export type WithdrawalRequest = Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string + + /** The date and time when the entity was first created. **/ + createdAt: string + + /** The date and time when the entity was last updated. **/ + updatedAt: string + + /** The amount of money that should be withdrawn in this request. **/ + amount: CurrencyAmount + + /** The bitcoin address where the funds should be sent. **/ + bitcoinAddress: string + + /** The current status of this withdrawal request. **/ + status: WithdrawalRequestStatus + + /** The typename of the object **/ + typename: string + + /** + * If the requested amount is `-1` (i.e. everything), this field may contain an estimate of the amount + * for the withdrawal. + **/ + estimatedAmount?: CurrencyAmount + + /** The time at which this request was completed. **/ + completedAt?: string + + /** The withdrawal transaction that has been generated by this request. **/ + withdrawalId?: string +} + +export const WithdrawalRequestFromJson = (obj: any): WithdrawalRequest => { + return { + id: obj['withdrawal_request_id'], + createdAt: obj['withdrawal_request_created_at'], + updatedAt: obj['withdrawal_request_updated_at'], + amount: CurrencyAmountFromJson(obj['withdrawal_request_amount']), + bitcoinAddress: obj['withdrawal_request_bitcoin_address'], + status: + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + WithdrawalRequestStatus[obj['withdrawal_request_status']] ?? + WithdrawalRequestStatus.FUTURE_VALUE, + typename: 'WithdrawalRequest', + estimatedAmount: obj['withdrawal_request_estimated_amount'] + ? CurrencyAmountFromJson(obj['withdrawal_request_estimated_amount']) + : undefined, + completedAt: obj['withdrawal_request_completed_at'], + withdrawalId: obj['withdrawal_request_withdrawal']?.id ?? undefined, + } as WithdrawalRequest +} + +export const WithdrawalRequestFragment = ` +fragment WithdrawalRequestFragment on WithdrawalRequest { + __typename + withdrawal_request_id: id + withdrawal_request_created_at: created_at + withdrawal_request_updated_at: updated_at + withdrawal_request_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_request_estimated_amount: estimated_amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + withdrawal_request_bitcoin_address: bitcoin_address + withdrawal_request_status: status + withdrawal_request_completed_at: completed_at + withdrawal_request_withdrawal: withdrawal { + id + } +}` + +export const getWithdrawalRequestQuery = ( + id: string, +): Query => { + return { + queryPayload: ` +query GetWithdrawalRequest($id: ID!) { + entity(id: $id) { + ... on WithdrawalRequest { + ...WithdrawalRequestFragment + } + } +} + +${WithdrawalRequestFragment} +`, + variables: { id }, + constructObject: (data: any) => WithdrawalRequestFromJson(data.entity), + } +} diff --git a/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequestStatus.ts b/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequestStatus.ts new file mode 100644 index 00000000..64980dba --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/WithdrawalRequestStatus.ts @@ -0,0 +1,15 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +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. + */ + FUTURE_VALUE = 'FUTURE_VALUE', + + FAILED = 'FAILED', + + IN_PROGRESS = 'IN_PROGRESS', + + SUCCESSFUL = 'SUCCESSFUL', +} diff --git a/packages/lightspark-wallet-sdk/src/objects/index.ts b/packages/lightspark-wallet-sdk/src/objects/index.ts new file mode 100644 index 00000000..aa957e68 --- /dev/null +++ b/packages/lightspark-wallet-sdk/src/objects/index.ts @@ -0,0 +1,68 @@ +export * from './AmazonS3FundsRecoveryKit' +export * from './Balances' +export * from './BitcoinNetwork' +export * from './ChannelClosingTransaction' +export * from './ChannelOpeningTransaction' +export * from './CreateBitcoinFundingAddressOutput' +export * from './CreateInvoiceInput' +export * from './CreateInvoiceOutput' +export * from './CreateTestModeInvoiceInputWallet' +export * from './CreateTestModeInvoiceOutput' +export * from './CreateTestModePaymentInputWallet' +export * from './CreateTestModePaymentoutput' +export * from './CurrencyAmount' +export * from './CurrencyUnit' +export * from './DeleteFundsRecoveryKitOutput' +export * from './DeployWalletOutput' +export * from './Deposit' +export * from './Entity' +export * from './FeeEstimate' +export * from './FundsRecoveryKit' +export * from './GraphNode' +export * from './IncomingPayment' +export * from './index' +export * from './InitializeWalletInput' +export * from './InitializeWalletOutput' +export * from './Invoice' +export * from './InvoiceData' +export * from './InvoiceType' +export * from './KeyInput' +export * from './KeyType' +export * from './LightningFeeEstimateForInvoiceInput' +export * from './LightningFeeEstimateForNodeInput' +export * from './LightningFeeEstimateOutput' +export * from './LightningTransaction' +export * from './LoginWithJWTInput' +export * from './LoginWithJWTOutput' +export * from './Node' +export * from './NodeAddress' +export * from './NodeAddressType' +export * from './NodeToAddressesConnection' +export * from './OnChainTransaction' +export * from './OutgoingPayment' +export * from './PageInfo' +export * from './PayInvoiceInput' +export * from './PayInvoiceOutput' +export * from './PaymentFailureReason' +export * from './PaymentRequest' +export * from './PaymentRequestData' +export * from './PaymentRequestStatus' +export * from './RequestWithdrawalInput' +export * from './RequestWithdrawalOutput' +export * from './RichText' +export * from './SendPaymentInput' +export * from './SendPaymentOutput' +export * from './TerminateWalletOutput' +export * from './Transaction' +export * from './TransactionStatus' +export * from './TransactionType' +export * from './UpdateFundsRecoveryKitInput' +export * from './UpdateFundsRecoveryKitOutput' +export * from './Wallet' +export * from './WalletDashboard' +export * from './WalletStatus' +export * from './WalletToPaymentRequestsConnection' +export * from './WalletToTransactionsConnection' +export * from './Withdrawal' +export * from './WithdrawalRequest' +export * from './WithdrawalRequestStatus' diff --git a/packages/lightspark-wallet-sdk/tsconfig.build.json b/packages/lightspark-wallet-sdk/tsconfig.build.json new file mode 100644 index 00000000..6b8bb22f --- /dev/null +++ b/packages/lightspark-wallet-sdk/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["src/tests", "**/*.test.ts"] +} diff --git a/packages/lightspark-wallet-sdk/tsconfig.json b/packages/lightspark-wallet-sdk/tsconfig.json new file mode 100644 index 00000000..da627652 --- /dev/null +++ b/packages/lightspark-wallet-sdk/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "lib": ["ESNext", "DOM"], + "paths": { + "@/*": ["src/*"] + } + }, + "include": ["src/**/*.ts"] +} diff --git a/yarn.lock b/yarn.lock index 3b809dad..a555fe58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,13 @@ __metadata: version: 6 cacheKey: 8 +"@aashutoshrathi/word-wrap@npm:^1.2.3": + version: 1.2.6 + resolution: "@aashutoshrathi/word-wrap@npm:1.2.6" + checksum: ada901b9e7c680d190f1d012c84217ce0063d8f5c5a7725bb91ec3c5ed99bb7572680eb2d2938a531ccbaec39a95422fcd8a6b4a13110c7d98dd75402f66a0cd + languageName: node + linkType: hard + "@ampproject/remapping@npm:^2.2.0": version: 2.2.1 resolution: "@ampproject/remapping@npm:2.2.1" @@ -15,197 +22,196 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.18.6, @babel/code-frame@npm:^7.21.4": - version: 7.21.4 - resolution: "@babel/code-frame@npm:7.21.4" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/code-frame@npm:7.22.5" dependencies: - "@babel/highlight": ^7.18.6 - checksum: e5390e6ec1ac58dcef01d4f18eaf1fd2f1325528661ff6d4a5de8979588b9f5a8e852a54a91b923846f7a5c681b217f0a45c2524eb9560553160cd963b7d592c + "@babel/highlight": ^7.22.5 + checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 languageName: node linkType: hard -"@babel/compat-data@npm:^7.21.5": - version: 7.21.7 - resolution: "@babel/compat-data@npm:7.21.7" - checksum: 28747eb3fc084d088ba2db0336f52118cfa730a57bdbac81630cae1f38ad0336605b95b3390325937802f344e0b7fa25e2f1b67e3ee2d7383b877f88dee0e51c +"@babel/compat-data@npm:^7.22.9": + version: 7.22.9 + resolution: "@babel/compat-data@npm:7.22.9" + checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 languageName: node linkType: hard "@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3": - version: 7.21.8 - resolution: "@babel/core@npm:7.21.8" + version: 7.22.9 + resolution: "@babel/core@npm:7.22.9" dependencies: "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.21.4 - "@babel/generator": ^7.21.5 - "@babel/helper-compilation-targets": ^7.21.5 - "@babel/helper-module-transforms": ^7.21.5 - "@babel/helpers": ^7.21.5 - "@babel/parser": ^7.21.8 - "@babel/template": ^7.20.7 - "@babel/traverse": ^7.21.5 - "@babel/types": ^7.21.5 + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.9 + "@babel/helper-compilation-targets": ^7.22.9 + "@babel/helper-module-transforms": ^7.22.9 + "@babel/helpers": ^7.22.6 + "@babel/parser": ^7.22.7 + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.8 + "@babel/types": ^7.22.5 convert-source-map: ^1.7.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.2 - semver: ^6.3.0 - checksum: f28118447355af2a90bd340e2e60699f94c8020517eba9b71bf8ebff62fa9e00d63f076e033f9dfb97548053ad62ada45fafb0d96584b1a90e8aef5a3b8241b1 + semver: ^6.3.1 + checksum: 7bf069aeceb417902c4efdaefab1f7b94adb7dea694a9aed1bda2edf4135348a080820529b1a300c6f8605740a00ca00c19b2d5e74b5dd489d99d8c11d5e56d1 languageName: node linkType: hard -"@babel/generator@npm:^7.21.5, @babel/generator@npm:^7.7.2": - version: 7.21.5 - resolution: "@babel/generator@npm:7.21.5" +"@babel/generator@npm:^7.22.7, @babel/generator@npm:^7.22.9, @babel/generator@npm:^7.7.2": + version: 7.22.9 + resolution: "@babel/generator@npm:7.22.9" dependencies: - "@babel/types": ^7.21.5 + "@babel/types": ^7.22.5 "@jridgewell/gen-mapping": ^0.3.2 "@jridgewell/trace-mapping": ^0.3.17 jsesc: ^2.5.1 - checksum: 78af737b9dd701d4c657f9731880430fa1c177767b562f4e8a330a7fe72a4abe857e3d24de4e6d9dafc1f6a11f894162d27e523d7e5948ff9e3925a0ce9867c4 + checksum: 7c9d2c58b8d5ac5e047421a6ab03ec2ff5d9a5ff2c2212130a0055e063ac349e0b19d435537d6886c999771aef394832e4f54cd9fc810100a7f23d982f6af06b languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-compilation-targets@npm:7.21.5" +"@babel/helper-compilation-targets@npm:^7.22.9": + version: 7.22.9 + resolution: "@babel/helper-compilation-targets@npm:7.22.9" dependencies: - "@babel/compat-data": ^7.21.5 - "@babel/helper-validator-option": ^7.21.0 - browserslist: ^4.21.3 + "@babel/compat-data": ^7.22.9 + "@babel/helper-validator-option": ^7.22.5 + browserslist: ^4.21.9 lru-cache: ^5.1.1 - semver: ^6.3.0 + semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0 - checksum: 0edecb9c970ddc22ebda1163e77a7f314121bef9e483e0e0d9a5802540eed90d5855b6bf9bce03419b35b2e07c323e62d0353b153fa1ca34f17dbba897a83c25 + checksum: ea0006c6a93759025f4a35a25228ae260538c9f15023e8aac2a6d45ca68aef4cf86cfc429b19af9a402cbdd54d5de74ad3fbcf6baa7e48184dc079f1a791e178 languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-environment-visitor@npm:7.21.5" - checksum: e436af7b62956e919066448013a3f7e2cd0b51010c26c50f790124dcd350be81d5597b4e6ed0a4a42d098a27de1e38561cd7998a116a42e7899161192deac9a6 +"@babel/helper-environment-visitor@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-environment-visitor@npm:7.22.5" + checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.21.0": - version: 7.21.0 - resolution: "@babel/helper-function-name@npm:7.21.0" +"@babel/helper-function-name@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-function-name@npm:7.22.5" dependencies: - "@babel/template": ^7.20.7 - "@babel/types": ^7.21.0 - checksum: d63e63c3e0e3e8b3138fa47b0cd321148a300ef12b8ee951196994dcd2a492cc708aeda94c2c53759a5c9177fffaac0fd8778791286746f72a000976968daf4e + "@babel/template": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a languageName: node linkType: hard -"@babel/helper-hoist-variables@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-hoist-variables@npm:7.18.6" +"@babel/helper-hoist-variables@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" dependencies: - "@babel/types": ^7.18.6 - checksum: fd9c35bb435fda802bf9ff7b6f2df06308a21277c6dec2120a35b09f9de68f68a33972e2c15505c1a1a04b36ec64c9ace97d4a9e26d6097b76b4396b7c5fa20f + "@babel/types": ^7.22.5 + checksum: 394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.21.4": - version: 7.21.4 - resolution: "@babel/helper-module-imports@npm:7.21.4" +"@babel/helper-module-imports@npm:^7.18.6, @babel/helper-module-imports@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-module-imports@npm:7.22.5" dependencies: - "@babel/types": ^7.21.4 - checksum: bd330a2edaafeb281fbcd9357652f8d2666502567c0aad71db926e8499c773c9ea9c10dfaae30122452940326d90c8caff5c649ed8e1bf15b23f858758d3abc6 + "@babel/types": ^7.22.5 + checksum: 9ac2b0404fa38b80bdf2653fbeaf8e8a43ccb41bd505f9741d820ed95d3c4e037c62a1bcdcb6c9527d7798d2e595924c4d025daed73283badc180ada2c9c49ad languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-module-transforms@npm:7.21.5" +"@babel/helper-module-transforms@npm:^7.22.9": + version: 7.22.9 + resolution: "@babel/helper-module-transforms@npm:7.22.9" dependencies: - "@babel/helper-environment-visitor": ^7.21.5 - "@babel/helper-module-imports": ^7.21.4 - "@babel/helper-simple-access": ^7.21.5 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/helper-validator-identifier": ^7.19.1 - "@babel/template": ^7.20.7 - "@babel/traverse": ^7.21.5 - "@babel/types": ^7.21.5 - checksum: 1ccfc88830675a5d485d198e918498f9683cdd46f973fdd4fe1c85b99648fb70f87fca07756c7a05dc201bd9b248c74ced06ea80c9991926ac889f53c3659675 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-module-imports": ^7.22.5 + "@babel/helper-simple-access": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/helper-validator-identifier": ^7.22.5 + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 2751f77660518cf4ff027514d6f4794f04598c6393be7b04b8e46c6e21606e11c19f3f57ab6129a9c21bacdf8b3ffe3af87bb401d972f34af2d0ffde02ac3001 languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.8.0": - version: 7.21.5 - resolution: "@babel/helper-plugin-utils@npm:7.21.5" - checksum: 6f086e9a84a50ea7df0d5639c8f9f68505af510ea3258b3c8ac8b175efdfb7f664436cb48996f71791a1350ba68f47ad3424131e8e718c5e2ad45564484cbb36 +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.8.0": + version: 7.22.5 + resolution: "@babel/helper-plugin-utils@npm:7.22.5" + checksum: c0fc7227076b6041acd2f0e818145d2e8c41968cc52fb5ca70eed48e21b8fe6dd88a0a91cbddf4951e33647336eb5ae184747ca706817ca3bef5e9e905151ff5 languageName: node linkType: hard -"@babel/helper-simple-access@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-simple-access@npm:7.21.5" +"@babel/helper-simple-access@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-simple-access@npm:7.22.5" dependencies: - "@babel/types": ^7.21.5 - checksum: ad212beaa24be3864c8c95bee02f840222457ccf5419991e2d3e3e39b0f75b77e7e857e0bf4ed428b1cd97acefc87f3831bdb0b9696d5ad0557421f398334fc3 + "@babel/types": ^7.22.5 + checksum: fe9686714caf7d70aedb46c3cce090f8b915b206e09225f1e4dbc416786c2fdbbee40b38b23c268b7ccef749dd2db35f255338fb4f2444429874d900dede5ad2 languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-split-export-declaration@npm:7.18.6" +"@babel/helper-split-export-declaration@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/helper-split-export-declaration@npm:7.22.6" dependencies: - "@babel/types": ^7.18.6 - checksum: c6d3dede53878f6be1d869e03e9ffbbb36f4897c7cc1527dc96c56d127d834ffe4520a6f7e467f5b6f3c2843ea0e81a7819d66ae02f707f6ac057f3d57943a2b + "@babel/types": ^7.22.5 + checksum: e141cace583b19d9195f9c2b8e17a3ae913b7ee9b8120246d0f9ca349ca6f03cb2c001fd5ec57488c544347c0bb584afec66c936511e447fd20a360e591ac921 languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helper-string-parser@npm:7.21.5" - checksum: 36c0ded452f3858e67634b81960d4bde1d1cd2a56b82f4ba2926e97864816021c885f111a7cf81de88a0ed025f49d84a393256700e9acbca2d99462d648705d8 +"@babel/helper-string-parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-string-parser@npm:7.22.5" + checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.18.6, @babel/helper-validator-identifier@npm:^7.19.1": - version: 7.19.1 - resolution: "@babel/helper-validator-identifier@npm:7.19.1" - checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a +"@babel/helper-validator-identifier@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-identifier@npm:7.22.5" + checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.21.0": - version: 7.21.0 - resolution: "@babel/helper-validator-option@npm:7.21.0" - checksum: 8ece4c78ffa5461fd8ab6b6e57cc51afad59df08192ed5d84b475af4a7193fc1cb794b59e3e7be64f3cdc4df7ac78bf3dbb20c129d7757ae078e6279ff8c2f07 +"@babel/helper-validator-option@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-validator-option@npm:7.22.5" + checksum: bbeca8a85ee86990215c0424997438b388b8d642d69b9f86c375a174d3cdeb270efafd1ff128bc7a1d370923d13b6e45829ba8581c027620e83e3a80c5c414b3 languageName: node linkType: hard -"@babel/helpers@npm:^7.21.5": - version: 7.21.5 - resolution: "@babel/helpers@npm:7.21.5" +"@babel/helpers@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/helpers@npm:7.22.6" dependencies: - "@babel/template": ^7.20.7 - "@babel/traverse": ^7.21.5 - "@babel/types": ^7.21.5 - checksum: a6f74b8579713988e7f5adf1a986d8b5255757632ba65b2552f0f609ead5476edb784044c7e4b18f3681ee4818ca9d08c41feb9bd4e828648c25a00deaa1f9e4 + "@babel/template": ^7.22.5 + "@babel/traverse": ^7.22.6 + "@babel/types": ^7.22.5 + checksum: 5c1f33241fe7bf7709868c2105134a0a86dca26a0fbd508af10a89312b1f77ca38ebae43e50be3b208613c5eacca1559618af4ca236f0abc55d294800faeff30 languageName: node linkType: hard -"@babel/highlight@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/highlight@npm:7.18.6" +"@babel/highlight@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/highlight@npm:7.22.5" dependencies: - "@babel/helper-validator-identifier": ^7.18.6 + "@babel/helper-validator-identifier": ^7.22.5 chalk: ^2.0.0 js-tokens: ^4.0.0 - checksum: 92d8ee61549de5ff5120e945e774728e5ccd57fd3b2ed6eace020ec744823d4a98e242be1453d21764a30a14769ecd62170fba28539b211799bbaf232bbb2789 + checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.5, @babel/parser@npm:^7.21.8": - version: 7.21.8 - resolution: "@babel/parser@npm:7.21.8" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7": + version: 7.22.7 + resolution: "@babel/parser@npm:7.22.7" bin: parser: ./bin/babel-parser.js - checksum: 1b9a820fedfb6ef179e6ffa1dbc080808882949dec68340a616da2aa354af66ea2886bd68e61bd444d270aa0b24ad6273e3cfaf17d6878c34bf2521becacb353 + checksum: 02209ddbd445831ee8bf966fdf7c29d189ed4b14343a68eb2479d940e7e3846340d7cc6bd654a5f3d87d19dc84f49f50a58cf9363bee249dc5409ff3ba3dab54 languageName: node linkType: hard @@ -265,13 +271,13 @@ __metadata: linkType: hard "@babel/plugin-syntax-jsx@npm:^7.7.2": - version: 7.21.4 - resolution: "@babel/plugin-syntax-jsx@npm:7.21.4" + version: 7.22.5 + resolution: "@babel/plugin-syntax-jsx@npm:7.22.5" dependencies: - "@babel/helper-plugin-utils": ^7.20.2 + "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: bb7309402a1d4e155f32aa0cf216e1fa8324d6c4cfd248b03280028a015a10e46b6efd6565f515f8913918a3602b39255999c06046f7d4b8a5106be2165d724a + checksum: 8829d30c2617ab31393d99cec2978e41f014f4ac6f01a1cecf4c4dd8320c3ec12fdc3ce121126b2d8d32f6887e99ca1a0bad53dedb1e6ad165640b92b24980ce languageName: node linkType: hard @@ -353,62 +359,62 @@ __metadata: linkType: hard "@babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.21.4 - resolution: "@babel/plugin-syntax-typescript@npm:7.21.4" + version: 7.22.5 + resolution: "@babel/plugin-syntax-typescript@npm:7.22.5" dependencies: - "@babel/helper-plugin-utils": ^7.20.2 + "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: a59ce2477b7ae8c8945dc37dda292fef9ce46a6507b3d76b03ce7f3a6c9451a6567438b20a78ebcb3955d04095fd1ccd767075a863f79fcc30aa34dcfa441fe0 + checksum: 8ab7718fbb026d64da93681a57797d60326097fd7cb930380c8bffd9eb101689e90142c760a14b51e8e69c88a73ba3da956cb4520a3b0c65743aee5c71ef360a languageName: node linkType: hard -"@babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.17.2": - version: 7.21.5 - resolution: "@babel/runtime@npm:7.21.5" +"@babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/runtime@npm:7.22.6" dependencies: regenerator-runtime: ^0.13.11 - checksum: 358f2779d3187f5c67ad302e8f8d435412925d0b991d133c7d4a7b1ddd5a3fda1b6f34537cb64628dfd96a27ae46df105bed3895b8d754b88cacdded8d1129dd + checksum: e585338287c4514a713babf4fdb8fc2a67adcebab3e7723a739fc62c79cfda875b314c90fd25f827afb150d781af97bc16c85bfdbfa2889f06053879a1ddb597 languageName: node linkType: hard -"@babel/template@npm:^7.20.7, @babel/template@npm:^7.3.3": - version: 7.20.7 - resolution: "@babel/template@npm:7.20.7" +"@babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": + version: 7.22.5 + resolution: "@babel/template@npm:7.22.5" dependencies: - "@babel/code-frame": ^7.18.6 - "@babel/parser": ^7.20.7 - "@babel/types": ^7.20.7 - checksum: 2eb1a0ab8d415078776bceb3473d07ab746e6bb4c2f6ca46ee70efb284d75c4a32bb0cd6f4f4946dec9711f9c0780e8e5d64b743208deac6f8e9858afadc349e + "@babel/code-frame": ^7.22.5 + "@babel/parser": ^7.22.5 + "@babel/types": ^7.22.5 + checksum: c5746410164039aca61829cdb42e9a55410f43cace6f51ca443313f3d0bdfa9a5a330d0b0df73dc17ef885c72104234ae05efede37c1cc8a72dc9f93425977a3 languageName: node linkType: hard -"@babel/traverse@npm:^7.21.5, @babel/traverse@npm:^7.7.2": - version: 7.21.5 - resolution: "@babel/traverse@npm:7.21.5" +"@babel/traverse@npm:^7.22.6, @babel/traverse@npm:^7.22.8": + version: 7.22.8 + resolution: "@babel/traverse@npm:7.22.8" dependencies: - "@babel/code-frame": ^7.21.4 - "@babel/generator": ^7.21.5 - "@babel/helper-environment-visitor": ^7.21.5 - "@babel/helper-function-name": ^7.21.0 - "@babel/helper-hoist-variables": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/parser": ^7.21.5 - "@babel/types": ^7.21.5 + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.7 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-function-name": ^7.22.5 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/parser": ^7.22.7 + "@babel/types": ^7.22.5 debug: ^4.1.0 globals: ^11.1.0 - checksum: b403733fa7d858f0c8e224f0434a6ade641bc469a4f92975363391e796629d5bf53e544761dfe85039aab92d5389ebe7721edb309d7a5bb7df2bf74f37bf9f47 + checksum: a381369bc3eedfd13ed5fef7b884657f1c29024ea7388198149f0edc34bd69ce3966e9f40188d15f56490a5e12ba250ccc485f2882b53d41b054fccefb233e33 languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.18.6, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.0, @babel/types@npm:^7.21.4, @babel/types@npm:^7.21.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": - version: 7.21.5 - resolution: "@babel/types@npm:7.21.5" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": + version: 7.22.5 + resolution: "@babel/types@npm:7.22.5" dependencies: - "@babel/helper-string-parser": ^7.21.5 - "@babel/helper-validator-identifier": ^7.19.1 + "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.5 to-fast-properties: ^2.0.0 - checksum: 43242a99c612d13285ee4af46cc0f1066bcb6ffd38307daef7a76e8c70f36cfc3255eb9e75c8e768b40e761176c313aec4d5c0b9d97a21e494d49d5fd123a9f7 + checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 languageName: node linkType: hard @@ -452,6 +458,25 @@ __metadata: languageName: unknown linkType: soft +"@distributedlab/lightspark-wallet-sdk@workspace:packages/lightspark-wallet-sdk": + version: 0.0.0-use.local + resolution: "@distributedlab/lightspark-wallet-sdk@workspace:packages/lightspark-wallet-sdk" + dependencies: + "@lightsparkdev/core": ^0.3.9 + "@react-native-async-storage/async-storage": ^1.19.1 + "@swc/cli": ^0.1.62 + "@swc/core": ^1.3.53 + "@swc/jest": ^0.2.26 + "@types/jest": ^29.5.1 + "@types/node": ^18.14.2 + bignumber.js: ^9.1.1 + dayjs: ^1.11.7 + jest: ^29.5.0 + tsc-alias: ^1.8.2 + tslib: ^2.5.0 + languageName: unknown + linkType: soft + "@distributedlab/reactivity@workspace:packages/reactivity": version: 0.0.0-use.local resolution: "@distributedlab/reactivity@workspace:packages/reactivity" @@ -517,34 +542,34 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.4.0": - version: 4.5.1 - resolution: "@eslint-community/regexpp@npm:4.5.1" - checksum: 6d901166d64998d591fab4db1c2f872981ccd5f6fe066a1ad0a93d4e11855ecae6bfb76660869a469563e8882d4307228cebd41142adb409d182f2966771e57e +"@eslint-community/regexpp@npm:^4.4.0, @eslint-community/regexpp@npm:^4.6.1": + version: 4.6.2 + resolution: "@eslint-community/regexpp@npm:4.6.2" + checksum: a3c341377b46b54fa228f455771b901d1a2717f95d47dcdf40199df30abc000ba020f747f114f08560d119e979d882a94cf46cfc51744544d54b00319c0f2724 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.0.3": - version: 2.0.3 - resolution: "@eslint/eslintrc@npm:2.0.3" +"@eslint/eslintrc@npm:^2.1.1": + version: 2.1.1 + resolution: "@eslint/eslintrc@npm:2.1.1" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^9.5.2 + espree: ^9.6.0 globals: ^13.19.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: ddc51f25f8524d8231db9c9bf03177e503d941a332e8d5ce3b10b09241be4d5584a378a529a27a527586bfbccf3031ae539eb891352033c340b012b4d0c81d92 + checksum: bf909ea183d27238c257a82d4ffdec38ca94b906b4b8dfae02ecbe7ecc9e5a8182ef5e469c808bb8cb4fea4750f43ac4ca7c4b4a167b6cd7e3aaacd386b2bd25 languageName: node linkType: hard -"@eslint/js@npm:8.40.0": - version: 8.40.0 - resolution: "@eslint/js@npm:8.40.0" - checksum: e84936b8ebd1c8fd90e860182e95d1404006da4cbca722b14950b298aeeca102b080aa9b62c8e69f90824ec54e19f1ba79b239046223624d1414ee82e8e628ac +"@eslint/js@npm:^8.46.0": + version: 8.46.0 + resolution: "@eslint/js@npm:8.46.0" + checksum: 7aed479832302882faf5bec37e9d068f270f84c19b3fb529646a7c1b031e73a312f730569c78806492bc09cfce3d7651dfab4ce09a56cbb06bc6469449e56377 languageName: node linkType: hard @@ -950,21 +975,14 @@ __metadata: languageName: node linkType: hard -"@gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 4059f790e2d07bf3c3ff3e0fec0daa8144fe35c1f6e0111c9921bd32106adaa97a4ab096ad7dab1e28ee6a9060083c4d1a4ada42a7f5f3f7a96b8812e2b757c1 - languageName: node - linkType: hard - -"@humanwhocodes/config-array@npm:^0.11.8": - version: 0.11.8 - resolution: "@humanwhocodes/config-array@npm:0.11.8" +"@humanwhocodes/config-array@npm:^0.11.10": + version: 0.11.10 + resolution: "@humanwhocodes/config-array@npm:0.11.10" dependencies: "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.5 - checksum: 0fd6b3c54f1674ce0a224df09b9c2f9846d20b9e54fabae1281ecfc04f2e6ad69bf19e1d6af6a28f88e8aa3990168b6cb9e1ef755868c3256a630605ec2cb1d3 + checksum: 1b1302e2403d0e35bc43e66d67a2b36b0ad1119efc704b5faff68c41f791a052355b010fb2d27ef022670f550de24cd6d08d5ecf0821c16326b7dcd0ee5d5d8a languageName: node linkType: hard @@ -982,6 +1000,20 @@ __metadata: languageName: node linkType: hard +"@isaacs/cliui@npm:^8.0.2": + version: 8.0.2 + resolution: "@isaacs/cliui@npm:8.0.2" + dependencies: + string-width: ^5.1.2 + string-width-cjs: "npm:string-width@^4.2.0" + strip-ansi: ^7.0.1 + strip-ansi-cjs: "npm:strip-ansi@^6.0.1" + wrap-ansi: ^8.1.0 + wrap-ansi-cjs: "npm:wrap-ansi@^7.0.0" + checksum: 4a473b9b32a7d4d3cfb7a614226e555091ff0c5a29a1734c28c72a182c2f6699b26fc6b5c2131dfd841e86b185aea714c72201d7c98c2fba5f17709333a67aeb + languageName: node + linkType: hard + "@istanbuljs/load-nyc-config@npm:^1.0.0": version: 1.1.0 resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" @@ -1002,29 +1034,29 @@ __metadata: languageName: node linkType: hard -"@jest/console@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/console@npm:29.5.0" +"@jest/console@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/console@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@types/node": "*" chalk: ^4.0.0 - jest-message-util: ^29.5.0 - jest-util: ^29.5.0 + jest-message-util: ^29.6.2 + jest-util: ^29.6.2 slash: ^3.0.0 - checksum: 9f4f4b8fabd1221361b7f2e92d4a90f5f8c2e2b29077249996ab3c8b7f765175ffee795368f8d6b5b2bb3adb32dc09319f7270c7c787b0d259e624e00e0f64a5 + checksum: 1198667bda0430770c3e9b92681c0ee9f8346394574071c633f306192ac5f08e12972d6a5fdf03eb0d441051c8439bce0f6f9f355dc60d98777a35328331ba2e languageName: node linkType: hard -"@jest/core@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/core@npm:29.5.0" +"@jest/core@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/core@npm:29.6.2" dependencies: - "@jest/console": ^29.5.0 - "@jest/reporters": ^29.5.0 - "@jest/test-result": ^29.5.0 - "@jest/transform": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/console": ^29.6.2 + "@jest/reporters": ^29.6.2 + "@jest/test-result": ^29.6.2 + "@jest/transform": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" ansi-escapes: ^4.2.1 chalk: ^4.0.0 @@ -1032,20 +1064,20 @@ __metadata: exit: ^0.1.2 graceful-fs: ^4.2.9 jest-changed-files: ^29.5.0 - jest-config: ^29.5.0 - jest-haste-map: ^29.5.0 - jest-message-util: ^29.5.0 + jest-config: ^29.6.2 + jest-haste-map: ^29.6.2 + jest-message-util: ^29.6.2 jest-regex-util: ^29.4.3 - jest-resolve: ^29.5.0 - jest-resolve-dependencies: ^29.5.0 - jest-runner: ^29.5.0 - jest-runtime: ^29.5.0 - jest-snapshot: ^29.5.0 - jest-util: ^29.5.0 - jest-validate: ^29.5.0 - jest-watcher: ^29.5.0 + jest-resolve: ^29.6.2 + jest-resolve-dependencies: ^29.6.2 + jest-runner: ^29.6.2 + jest-runtime: ^29.6.2 + jest-snapshot: ^29.6.2 + jest-util: ^29.6.2 + jest-validate: ^29.6.2 + jest-watcher: ^29.6.2 micromatch: ^4.0.4 - pretty-format: ^29.5.0 + pretty-format: ^29.6.2 slash: ^3.0.0 strip-ansi: ^6.0.0 peerDependencies: @@ -1053,7 +1085,7 @@ __metadata: peerDependenciesMeta: node-notifier: optional: true - checksum: 9e8f5243fe82d5a57f3971e1b96f320058df7c315328a3a827263f3b17f64be10c80f4a9c1b1773628b64d2de6d607c70b5b2d5bf13e7f5ad04223e9ef6aac06 + checksum: 6bbb3886430248c0092f275b1b946a701406732f7442c04e63e4ee2297c2ec02d8ceeec508a202e08128197699b2bcddbae2c2f74adb2cf30f2f0d7d94a7c2dc languageName: node linkType: hard @@ -1066,73 +1098,73 @@ __metadata: languageName: node linkType: hard -"@jest/environment@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/environment@npm:29.5.0" +"@jest/environment@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/environment@npm:29.6.2" dependencies: - "@jest/fake-timers": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/fake-timers": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" - jest-mock: ^29.5.0 - checksum: 921de6325cd4817dec6685e5ff299b499b6379f3f9cf489b4b13588ee1f3820a0c77b49e6a087996b6de8f629f6f5251e636cba08d1bdb97d8071cc7d033c88a + jest-mock: ^29.6.2 + checksum: c7de0e4c0d9166e02d0eb166574e05ec460e1db3b69d6476e63244edd52d7c917e6876af55fe723ff3086f52c0b1869dec60654054735a7a48c9d4ac43af2a25 languageName: node linkType: hard -"@jest/expect-utils@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/expect-utils@npm:29.5.0" +"@jest/expect-utils@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/expect-utils@npm:29.6.2" dependencies: jest-get-type: ^29.4.3 - checksum: c46fb677c88535cf83cf29f0a5b1f376c6a1109ddda266ad7da1a9cbc53cb441fa402dd61fc7b111ffc99603c11a9b3357ee41a1c0e035a58830bcb360871476 + checksum: 0decf2009aa3735f9df469e78ce1721c2815e4278439887e0cf0321ca8979541a22515d114a59b2445a6cd70a074b09dc9c00b5e7b3b3feac5174b9c4a78b2e1 languageName: node linkType: hard -"@jest/expect@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/expect@npm:29.5.0" +"@jest/expect@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/expect@npm:29.6.2" dependencies: - expect: ^29.5.0 - jest-snapshot: ^29.5.0 - checksum: bd10e295111547e6339137107d83986ab48d46561525393834d7d2d8b2ae9d5626653f3f5e48e5c3fa742ac982e97bdf1f541b53b9e1d117a247b08e938527f6 + expect: ^29.6.2 + jest-snapshot: ^29.6.2 + checksum: bd2d88a4e7c5420079c239afef341ec53dc7e353816cd13acbb42631a31fd321fe58677bb43a4dba851028f4c7e31da7980314e9094cd5b348896cb6cd3d42b2 languageName: node linkType: hard -"@jest/fake-timers@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/fake-timers@npm:29.5.0" +"@jest/fake-timers@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/fake-timers@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@sinonjs/fake-timers": ^10.0.2 "@types/node": "*" - jest-message-util: ^29.5.0 - jest-mock: ^29.5.0 - jest-util: ^29.5.0 - checksum: 69930c6922341f244151ec0d27640852ec96237f730fc024da1f53143d31b43cde75d92f9d8e5937981cdce3b31416abc3a7090a0d22c2377512c4a6613244ee + jest-message-util: ^29.6.2 + jest-mock: ^29.6.2 + jest-util: ^29.6.2 + checksum: 1abcda02f22d2ba32e178b7ab80a9180235a6c75ec9faef33324627b19a70dad64889a9ea49b8f07230e14a6e683b9120542c6d1d6b2ecaf937f4efde32dad88 languageName: node linkType: hard -"@jest/globals@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/globals@npm:29.5.0" +"@jest/globals@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/globals@npm:29.6.2" dependencies: - "@jest/environment": ^29.5.0 - "@jest/expect": ^29.5.0 - "@jest/types": ^29.5.0 - jest-mock: ^29.5.0 - checksum: b309ab8f21b571a7c672608682e84bbdd3d2b554ddf81e4e32617fec0a69094a290ab42e3c8b2c66ba891882bfb1b8b2736720ea1285b3ad646d55c2abefedd9 + "@jest/environment": ^29.6.2 + "@jest/expect": ^29.6.2 + "@jest/types": ^29.6.1 + jest-mock: ^29.6.2 + checksum: aa4a54f19cc025205bc696546940e1fe9c752c2d4d825852088aa76d44677ebba1ec66fabb78e615480cff23a06a70b5a3f893ab5163d901cdfa0d2267870b10 languageName: node linkType: hard -"@jest/reporters@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/reporters@npm:29.5.0" +"@jest/reporters@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/reporters@npm:29.6.2" dependencies: "@bcoe/v8-coverage": ^0.2.3 - "@jest/console": ^29.5.0 - "@jest/test-result": ^29.5.0 - "@jest/transform": ^29.5.0 - "@jest/types": ^29.5.0 - "@jridgewell/trace-mapping": ^0.3.15 + "@jest/console": ^29.6.2 + "@jest/test-result": ^29.6.2 + "@jest/transform": ^29.6.2 + "@jest/types": ^29.6.1 + "@jridgewell/trace-mapping": ^0.3.18 "@types/node": "*" chalk: ^4.0.0 collect-v8-coverage: ^1.0.0 @@ -1144,9 +1176,9 @@ __metadata: istanbul-lib-report: ^3.0.0 istanbul-lib-source-maps: ^4.0.0 istanbul-reports: ^3.1.3 - jest-message-util: ^29.5.0 - jest-util: ^29.5.0 - jest-worker: ^29.5.0 + jest-message-util: ^29.6.2 + jest-util: ^29.6.2 + jest-worker: ^29.6.2 slash: ^3.0.0 string-length: ^4.0.1 strip-ansi: ^6.0.0 @@ -1156,74 +1188,74 @@ __metadata: peerDependenciesMeta: node-notifier: optional: true - checksum: 481268aac9a4a75cc49c4df1273d6b111808dec815e9d009dad717c32383ebb0cebac76e820ad1ab44e207540e1c2fe1e640d44c4f262de92ab1933e057fdeeb + checksum: 7cf880d0730cee7d24ee96928003ef6946bf93423b0ae9a2edb53cae2c231b8ac50ec264f48a73744e3f11ca319cd414edacf99b2e7bf37cd72fe0b362090dd1 languageName: node linkType: hard -"@jest/schemas@npm:^29.4.3": - version: 29.4.3 - resolution: "@jest/schemas@npm:29.4.3" +"@jest/schemas@npm:^29.6.0": + version: 29.6.0 + resolution: "@jest/schemas@npm:29.6.0" dependencies: - "@sinclair/typebox": ^0.25.16 - checksum: ac754e245c19dc39e10ebd41dce09040214c96a4cd8efa143b82148e383e45128f24599195ab4f01433adae4ccfbe2db6574c90db2862ccd8551a86704b5bebd + "@sinclair/typebox": ^0.27.8 + checksum: c00511c69cf89138a7d974404d3a5060af375b5a52b9c87215d91873129b382ca11c1ff25bd6d605951404bb381ddce5f8091004a61e76457da35db1f5c51365 languageName: node linkType: hard -"@jest/source-map@npm:^29.4.3": - version: 29.4.3 - resolution: "@jest/source-map@npm:29.4.3" +"@jest/source-map@npm:^29.6.0": + version: 29.6.0 + resolution: "@jest/source-map@npm:29.6.0" dependencies: - "@jridgewell/trace-mapping": ^0.3.15 + "@jridgewell/trace-mapping": ^0.3.18 callsites: ^3.0.0 graceful-fs: ^4.2.9 - checksum: 2301d225145f8123540c0be073f35a80fd26a2f5e59550fd68525d8cea580fb896d12bf65106591ffb7366a8a19790076dbebc70e0f5e6ceb51f81827ed1f89c + checksum: 9c6c40387410bb70b2fae8124287fc28f6bdd1b2d7f24348e8611e1bb638b404518228a4ce64a582365b589c536ae8e7ebab0126cef59a87874b71061d19783b languageName: node linkType: hard -"@jest/test-result@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/test-result@npm:29.5.0" +"@jest/test-result@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/test-result@npm:29.6.2" dependencies: - "@jest/console": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/console": ^29.6.2 + "@jest/types": ^29.6.1 "@types/istanbul-lib-coverage": ^2.0.0 collect-v8-coverage: ^1.0.0 - checksum: 2e8ff5242227ab960c520c3ea0f6544c595cc1c42fa3873c158e9f4f685f4ec9670ec08a4af94ae3885c0005a43550a9595191ffbc27a0965df27d9d98bbf901 + checksum: 8aff37f18c8d2df4d9f453d57ec018a6479eb697fabcf74b1ca06e34553da1d7a2b85580a290408ba0b02e58543263244a2cb065c7c7180c8d8180cc78444fbd languageName: node linkType: hard -"@jest/test-sequencer@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/test-sequencer@npm:29.5.0" +"@jest/test-sequencer@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/test-sequencer@npm:29.6.2" dependencies: - "@jest/test-result": ^29.5.0 + "@jest/test-result": ^29.6.2 graceful-fs: ^4.2.9 - jest-haste-map: ^29.5.0 + jest-haste-map: ^29.6.2 slash: ^3.0.0 - checksum: eca34b4aeb2fda6dfb7f9f4b064c858a7adf64ec5c6091b6f4ed9d3c19549177cbadcf1c615c4c182688fa1cf085c8c55c3ca6eea40719a34554b0bf071d842e + checksum: 12dc2577e45eeb98b85d1769846b7d6effa536907986ad3c4cbd014df9e24431a564cc8cd94603332e4b1f9bfb421371883efc6a5085b361a52425ffc2a52dc6 languageName: node linkType: hard -"@jest/transform@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/transform@npm:29.5.0" +"@jest/transform@npm:^29.6.2": + version: 29.6.2 + resolution: "@jest/transform@npm:29.6.2" dependencies: "@babel/core": ^7.11.6 - "@jest/types": ^29.5.0 - "@jridgewell/trace-mapping": ^0.3.15 + "@jest/types": ^29.6.1 + "@jridgewell/trace-mapping": ^0.3.18 babel-plugin-istanbul: ^6.1.1 chalk: ^4.0.0 convert-source-map: ^2.0.0 fast-json-stable-stringify: ^2.1.0 graceful-fs: ^4.2.9 - jest-haste-map: ^29.5.0 + jest-haste-map: ^29.6.2 jest-regex-util: ^29.4.3 - jest-util: ^29.5.0 + jest-util: ^29.6.2 micromatch: ^4.0.4 pirates: ^4.0.4 slash: ^3.0.0 write-file-atomic: ^4.0.2 - checksum: d55d604085c157cf5112e165ff5ac1fa788873b3b31265fb4734ca59892ee24e44119964cc47eb6d178dd9512bbb6c576d1e20e51a201ff4e24d31e818a1c92d + checksum: ffb8c3c344cd48bedadec295d9c436737eccc39c1f0868aa9753b76397b33b2e5b121058af6f287ba6f2036181137e37df1212334bfa9d9a712986a4518cdc18 languageName: node linkType: hard @@ -1240,17 +1272,17 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^29.5.0": - version: 29.5.0 - resolution: "@jest/types@npm:29.5.0" +"@jest/types@npm:^29.6.1": + version: 29.6.1 + resolution: "@jest/types@npm:29.6.1" dependencies: - "@jest/schemas": ^29.4.3 + "@jest/schemas": ^29.6.0 "@types/istanbul-lib-coverage": ^2.0.0 "@types/istanbul-reports": ^3.0.0 "@types/node": "*" "@types/yargs": ^17.0.8 chalk: ^4.0.0 - checksum: 1811f94b19cf8a9460a289c4f056796cfc373480e0492692a6125a553cd1a63824bd846d7bb78820b7b6f758f6dd3c2d4558293bb676d541b2fa59c70fdf9d39 + checksum: 89fc1ccf71a84fe0da643e0675b1cfe6a6f19ea72e935b2ab1dbdb56ec547e94433fb59b3536d3832a6e156c077865b7176fe9dae707dab9c3d2f9405ba6233c languageName: node linkType: hard @@ -1279,13 +1311,13 @@ __metadata: languageName: node linkType: hard -"@jridgewell/source-map@npm:^0.3.2": - version: 0.3.3 - resolution: "@jridgewell/source-map@npm:0.3.3" +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.5 + resolution: "@jridgewell/source-map@npm:0.3.5" dependencies: "@jridgewell/gen-mapping": ^0.3.0 "@jridgewell/trace-mapping": ^0.3.9 - checksum: ae1302146339667da5cd6541260ecbef46ae06819a60f88da8f58b3e64682f787c09359933d050dea5d2173ea7fa40f40dd4d4e7a8d325c5892cccd99aaf8959 + checksum: 1ad4dec0bdafbade57920a50acec6634f88a0eb735851e0dda906fa9894e7f0549c492678aad1a10f8e144bfe87f238307bf2a914a1bc85b7781d345417e9f6f languageName: node linkType: hard @@ -1303,7 +1335,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.15, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.18 resolution: "@jridgewell/trace-mapping@npm:0.3.18" dependencies: @@ -1313,6 +1345,23 @@ __metadata: languageName: node linkType: hard +"@lightsparkdev/core@npm:^0.3.9": + version: 0.3.9 + resolution: "@lightsparkdev/core@npm:0.3.9" + dependencies: + auto-bind: ^5.0.1 + crypto: ^1.0.1 + crypto-browserify: ^3.12.0 + dayjs: ^1.11.7 + graphql: ^16.6.0 + graphql-ws: ^5.11.3 + text-encoding: ^0.7.0 + ws: ^8.12.1 + zen-observable-ts: ^1.1.0 + checksum: ddf32e523e45aa9db64670bab1c6fbdf6d9f009d14070a998224a680a45c5c716d336c2fd69ff5335269369e17179b81e41f6fb66dff190f8039616e4673bd16 + languageName: node + linkType: hard + "@mole-inc/bin-wrapper@npm:^8.0.1": version: 8.0.1 resolution: "@mole-inc/bin-wrapper@npm:8.0.1" @@ -1365,18 +1414,18 @@ __metadata: linkType: hard "@noble/curves@npm:^1.0.0": - version: 1.0.0 - resolution: "@noble/curves@npm:1.0.0" + version: 1.1.0 + resolution: "@noble/curves@npm:1.1.0" dependencies: - "@noble/hashes": 1.3.0 - checksum: 6bcef44d626c640dc8961819d68dd67dffb907e3b973b7c27efe0ecdd9a5c6ce62c7b9e3dfc930c66605dced7f1ec0514d191c09a2ce98d6d52b66e3315ffa79 + "@noble/hashes": 1.3.1 + checksum: 2658cdd3f84f71079b4e3516c47559d22cf4b55c23ac8ee9d2b1f8e5b72916d9689e59820e0f9d9cb4a46a8423af5b56dc6bb7782405c88be06a015180508db5 languageName: node linkType: hard -"@noble/hashes@npm:1.3.0, @noble/hashes@npm:^1.3.0": - version: 1.3.0 - resolution: "@noble/hashes@npm:1.3.0" - checksum: d7ddb6d7c60f1ce1f87facbbef5b724cdea536fc9e7f59ae96e0fc9de96c8f1a2ae2bdedbce10f7dcc621338dfef8533daa73c873f2b5c87fa1a4e05a95c2e2e +"@noble/hashes@npm:1.3.1, @noble/hashes@npm:^1.3.0": + version: 1.3.1 + resolution: "@noble/hashes@npm:1.3.1" + checksum: 7fdefc0f7a0c1ec27acc6ff88841793e3f93ec4ce6b8a6a12bfc0dd70ae6b7c4c82fe305fdfeda1735d5ad4a9eebe761e6693b3d355689c559e91242f4bc95b1 languageName: node linkType: hard @@ -1407,23 +1456,30 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^2.1.0": - version: 2.1.2 - resolution: "@npmcli/fs@npm:2.1.2" +"@npmcli/fs@npm:^3.1.0": + version: 3.1.0 + resolution: "@npmcli/fs@npm:3.1.0" dependencies: - "@gar/promisify": ^1.1.3 semver: ^7.3.5 - checksum: 405074965e72d4c9d728931b64d2d38e6ea12066d4fad651ac253d175e413c06fe4350970c783db0d749181da8fe49c42d3880bd1cbc12cd68e3a7964d820225 + checksum: a50a6818de5fc557d0b0e6f50ec780a7a02ab8ad07e5ac8b16bf519e0ad60a144ac64f97d05c443c3367235d337182e1d012bbac0eb8dbae8dc7b40b193efd0e languageName: node linkType: hard -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/move-file@npm:2.0.1" +"@pkgjs/parseargs@npm:^0.11.0": + version: 0.11.0 + resolution: "@pkgjs/parseargs@npm:0.11.0" + checksum: 6ad6a00fc4f2f2cfc6bff76fb1d88b8ee20bc0601e18ebb01b6d4be583733a860239a521a7fbca73b612e66705078809483549d2b18f370eb346c5155c8e4a0f + languageName: node + linkType: hard + +"@react-native-async-storage/async-storage@npm:^1.19.1": + version: 1.19.1 + resolution: "@react-native-async-storage/async-storage@npm:1.19.1" dependencies: - mkdirp: ^1.0.4 - rimraf: ^3.0.2 - checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 + merge-options: ^3.0.4 + peerDependencies: + react-native: ^0.0.0-0 || 0.60 - 0.72 || 1000.0.0 + checksum: 7367210e16f788999ca8ff96bd04bbd345f44c186cec7c50903d55637f572c73b8a79f9c948a549329ad489c08d77dd49367971691ed54dbc3839285e0194431 languageName: node linkType: hard @@ -1510,8 +1566,8 @@ __metadata: linkType: hard "@rollup/plugin-node-resolve@npm:^15.0.1": - version: 15.0.2 - resolution: "@rollup/plugin-node-resolve@npm:15.0.2" + version: 15.1.0 + resolution: "@rollup/plugin-node-resolve@npm:15.1.0" dependencies: "@rollup/pluginutils": ^5.0.1 "@types/resolve": 1.20.2 @@ -1524,7 +1580,7 @@ __metadata: peerDependenciesMeta: rollup: optional: true - checksum: 328eafee06ff967a36441b55e77fbd0d4f599d256e5d1977800ee71915846c46bc1b6185df35c7b512ad2b4023b05b65a332be77b8b00b9d8a20f87d056b8166 + checksum: 83617cdbb90cb780251e8b16dc1671e35bde90b8d4d30e008aefe706b5b643057f6299bdd3226b2a30bf5e4f807a880169de3faa47b9f2ba38d39f294f85f951 languageName: node linkType: hard @@ -1545,8 +1601,8 @@ __metadata: linkType: hard "@rollup/plugin-typescript@npm:^11.0.0": - version: 11.1.1 - resolution: "@rollup/plugin-typescript@npm:11.1.1" + version: 11.1.2 + resolution: "@rollup/plugin-typescript@npm:11.1.2" dependencies: "@rollup/pluginutils": ^5.0.1 resolve: ^1.22.1 @@ -1559,7 +1615,7 @@ __metadata: optional: true tslib: optional: true - checksum: 0e82ef17ded026060bbc237ed2552e227d5b514cd58c1f624afeb65704a24048e38918e6242bcf29960612dc9925fbf1bb0625475ec691330cd144e4a84e3065 + checksum: f4655a35e08639574e86dbce578b76468ee8627e4a3d8a46b7e0703d5d98c39a9bda9aa7144510aae11c5d8ce9c3b065e7f3e52dd31fbc6780015dd7802e01f7 languageName: node linkType: hard @@ -1579,10 +1635,10 @@ __metadata: languageName: node linkType: hard -"@sinclair/typebox@npm:^0.25.16": - version: 0.25.24 - resolution: "@sinclair/typebox@npm:0.25.24" - checksum: 10219c58f40b8414c50b483b0550445e9710d4fe7b2c4dccb9b66533dd90ba8e024acc776026cebe81e87f06fa24b07fdd7bc30dd277eb9cc386ec50151a3026 +"@sinclair/typebox@npm:^0.27.8": + version: 0.27.8 + resolution: "@sinclair/typebox@npm:0.27.8" + checksum: 00bd7362a3439021aa1ea51b0e0d0a0e8ca1351a3d54c606b115fdcc49b51b16db6e5f43b4fe7a28c38688523e22a94d49dd31168868b655f0d4d50f032d07a1 languageName: node linkType: hard @@ -1603,11 +1659,11 @@ __metadata: linkType: hard "@sinonjs/fake-timers@npm:^10.0.2": - version: 10.2.0 - resolution: "@sinonjs/fake-timers@npm:10.2.0" + version: 10.3.0 + resolution: "@sinonjs/fake-timers@npm:10.3.0" dependencies: "@sinonjs/commons": ^3.0.0 - checksum: 586c76e1dd90d03b0c4e754f2011325b38ac6055878c81c52434c900f36d9d245438c96ef69e08e28d9fbecf2335fb347b67850962d8b6e539dd7359d8c62802 + checksum: 614d30cb4d5201550c940945d44c9e0b6d64a888ff2cd5b357f95ad6721070d6b8839cd10e15b76bf5e14af0bcc1d8f9ec00d49a46318f1f669a4bec1d7f3148 languageName: node linkType: hard @@ -1621,25 +1677,25 @@ __metadata: linkType: hard "@solana/web3.js@npm:^1.73.2": - version: 1.76.0 - resolution: "@solana/web3.js@npm:1.76.0" + version: 1.78.3 + resolution: "@solana/web3.js@npm:1.78.3" dependencies: - "@babel/runtime": ^7.12.5 + "@babel/runtime": ^7.22.6 "@noble/curves": ^1.0.0 "@noble/hashes": ^1.3.0 "@solana/buffer-layout": ^4.0.0 - agentkeepalive: ^4.2.1 + agentkeepalive: ^4.3.0 bigint-buffer: ^1.1.5 - bn.js: ^5.0.0 + bn.js: ^5.2.1 borsh: ^0.7.0 bs58: ^4.0.1 buffer: 6.0.3 fast-stable-stringify: ^1.0.0 - jayson: ^3.4.4 - node-fetch: ^2.6.7 + jayson: ^4.1.0 + node-fetch: ^2.6.12 rpc-websockets: ^7.5.1 superstruct: ^0.14.2 - checksum: f42f7cae09cef78ee169933e1df7676f2e11b34783b2fa726f3207e3d696054feb79ed8539526f170d609001474d07973457732a64396c74eb78c9eed614b45b + checksum: 6d652c31ffcd7c21425a39db58a7017c74922c9c0a515022f1f8025c1822d8bc8aab5bbcdcebae23d6dd8cb30d7f43f321c297fad3602b704179be091dd4922a languageName: node linkType: hard @@ -1667,90 +1723,90 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-darwin-arm64@npm:1.3.58" +"@swc/core-darwin-arm64@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-darwin-arm64@npm:1.3.74" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-darwin-x64@npm:1.3.58" +"@swc/core-darwin-x64@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-darwin-x64@npm:1.3.74" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.58" +"@swc/core-linux-arm-gnueabihf@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.74" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-linux-arm64-gnu@npm:1.3.58" +"@swc/core-linux-arm64-gnu@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-linux-arm64-gnu@npm:1.3.74" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-linux-arm64-musl@npm:1.3.58" +"@swc/core-linux-arm64-musl@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-linux-arm64-musl@npm:1.3.74" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-linux-x64-gnu@npm:1.3.58" +"@swc/core-linux-x64-gnu@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-linux-x64-gnu@npm:1.3.74" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-linux-x64-musl@npm:1.3.58" +"@swc/core-linux-x64-musl@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-linux-x64-musl@npm:1.3.74" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-win32-arm64-msvc@npm:1.3.58" +"@swc/core-win32-arm64-msvc@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-win32-arm64-msvc@npm:1.3.74" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-win32-ia32-msvc@npm:1.3.58" +"@swc/core-win32-ia32-msvc@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-win32-ia32-msvc@npm:1.3.74" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.3.58": - version: 1.3.58 - resolution: "@swc/core-win32-x64-msvc@npm:1.3.58" +"@swc/core-win32-x64-msvc@npm:1.3.74": + version: 1.3.74 + resolution: "@swc/core-win32-x64-msvc@npm:1.3.74" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@swc/core@npm:^1.3.53": - version: 1.3.58 - resolution: "@swc/core@npm:1.3.58" - dependencies: - "@swc/core-darwin-arm64": 1.3.58 - "@swc/core-darwin-x64": 1.3.58 - "@swc/core-linux-arm-gnueabihf": 1.3.58 - "@swc/core-linux-arm64-gnu": 1.3.58 - "@swc/core-linux-arm64-musl": 1.3.58 - "@swc/core-linux-x64-gnu": 1.3.58 - "@swc/core-linux-x64-musl": 1.3.58 - "@swc/core-win32-arm64-msvc": 1.3.58 - "@swc/core-win32-ia32-msvc": 1.3.58 - "@swc/core-win32-x64-msvc": 1.3.58 + version: 1.3.74 + resolution: "@swc/core@npm:1.3.74" + dependencies: + "@swc/core-darwin-arm64": 1.3.74 + "@swc/core-darwin-x64": 1.3.74 + "@swc/core-linux-arm-gnueabihf": 1.3.74 + "@swc/core-linux-arm64-gnu": 1.3.74 + "@swc/core-linux-arm64-musl": 1.3.74 + "@swc/core-linux-x64-gnu": 1.3.74 + "@swc/core-linux-x64-musl": 1.3.74 + "@swc/core-win32-arm64-msvc": 1.3.74 + "@swc/core-win32-ia32-msvc": 1.3.74 + "@swc/core-win32-x64-msvc": 1.3.74 peerDependencies: "@swc/helpers": ^0.5.0 dependenciesMeta: @@ -1777,19 +1833,19 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 34e5a1046aab51e55b35b966e54de8f1bcdef2535c297d76a9b0e38cba126599c24b5062c9c6ce9d4c6b5745c91e8a2eda596fe39ab27093459e8aa2934cf387 + checksum: fd61d65fbfceb372178a14cfa998c649481a728e33b68bad90fed0ff05b34fb432f88dafb0c2257d54c4de49cdcdd12d2b5fe66f79abc553656445910f163adb languageName: node linkType: hard "@swc/jest@npm:^0.2.26": - version: 0.2.26 - resolution: "@swc/jest@npm:0.2.26" + version: 0.2.27 + resolution: "@swc/jest@npm:0.2.27" dependencies: "@jest/create-cache-key-function": ^27.4.2 jsonc-parser: ^3.2.0 peerDependencies: "@swc/core": "*" - checksum: 771821ed08cf168ca0b6307dee7689253d0af0685acd08408ac431860a7c42ace892db2cb6bb6dcfe297edbdce0f2e22d44ed4ed72d1c621be9e841cffd408a0 + checksum: db258e13f9eb9441d4d924684452939fb49016a4a2eaf7700cbf5eb4f90dff96bb7ce240ed539adbcd41b45fe62bacdc1d3f3d995403af44d54501b41f1ec72f languageName: node linkType: hard @@ -1817,15 +1873,15 @@ __metadata: linkType: hard "@types/babel__core@npm:^7.1.14": - version: 7.20.0 - resolution: "@types/babel__core@npm:7.20.0" + version: 7.20.1 + resolution: "@types/babel__core@npm:7.20.1" dependencies: "@babel/parser": ^7.20.7 "@babel/types": ^7.20.7 "@types/babel__generator": "*" "@types/babel__template": "*" "@types/babel__traverse": "*" - checksum: 49b601a0a7637f1f387442c8156bd086cfd10ff4b82b0e1994e73a6396643b5435366fb33d6b604eade8467cca594ef97adcbc412aede90bb112ebe88d0ad6df + checksum: 9fcd9691a33074802d9057ff70b0e3ff3778f52470475b68698a0f6714fbe2ccb36c16b43dc924eb978cd8a81c1f845e5ff4699e7a47606043b539eb8c6331a8 languageName: node linkType: hard @@ -1849,11 +1905,11 @@ __metadata: linkType: hard "@types/babel__traverse@npm:*, @types/babel__traverse@npm:^7.0.6": - version: 7.18.5 - resolution: "@types/babel__traverse@npm:7.18.5" + version: 7.20.1 + resolution: "@types/babel__traverse@npm:7.20.1" dependencies: - "@babel/types": ^7.3.0 - checksum: b9e7f39eb84626cc8f83ebf75a621d47f04b53cb085a3ea738a9633d57cf65208e503b1830db91aa5e297bc2ba761681ac0b0cbfb7a3d56afcfb2296212668ef + "@babel/types": ^7.20.7 + checksum: 58341e23c649c0eba134a1682d4f20d027fad290d92e5740faa1279978f6ed476fc467ae51ce17a877e2566d805aeac64eae541168994367761ec883a4150221 languageName: node linkType: hard @@ -1879,12 +1935,12 @@ __metadata: linkType: hard "@types/eslint@npm:^8": - version: 8.37.0 - resolution: "@types/eslint@npm:8.37.0" + version: 8.44.2 + resolution: "@types/eslint@npm:8.44.2" dependencies: "@types/estree": "*" "@types/json-schema": "*" - checksum: 06d3b3fba12004294591b5c7a52e3cec439472195da54e096076b1f2ddfbb8a445973b9681046dd530a6ac31eca502f635abc1e3ce37d03513089358e6f822ee + checksum: 25b3ef61bae96350026593c9914c8a61ee02fde48ab8d568a73ee45032f13c0028c62e47a5ff78715af488dfe8e8bba913f7d30f859f60c7f9e639d328e80482 languageName: node linkType: hard @@ -1937,19 +1993,19 @@ __metadata: linkType: hard "@types/jest@npm:^29.5.1": - version: 29.5.1 - resolution: "@types/jest@npm:29.5.1" + version: 29.5.3 + resolution: "@types/jest@npm:29.5.3" dependencies: expect: ^29.0.0 pretty-format: ^29.0.0 - checksum: 0a22491dec86333c0e92b897be2c809c922a7b2b0aa5604ac369810d6b2360908b4a3f2c6892e8a237a54fa1f10ecefe0e823ec5fcb7915195af4dfe88d2197e + checksum: e36bb92e0b9e5ea7d6f8832baa42f087fc1697f6cd30ec309a07ea4c268e06ec460f1f0cfd2581daf5eff5763475190ec1ad8ac6520c49ccfe4f5c0a48bfa676 languageName: node linkType: hard "@types/json-schema@npm:*, @types/json-schema@npm:^7.0.9": - version: 7.0.11 - resolution: "@types/json-schema@npm:7.0.11" - checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d + version: 7.0.12 + resolution: "@types/json-schema@npm:7.0.12" + checksum: 00239e97234eeb5ceefb0c1875d98ade6e922bfec39dd365ec6bd360b5c2f825e612ac4f6e5f1d13601b8b30f378f15e6faa805a3a732f4a1bbe61915163d293 languageName: node linkType: hard @@ -1970,16 +2026,16 @@ __metadata: linkType: hard "@types/lodash@npm:^4": - version: 4.14.194 - resolution: "@types/lodash@npm:4.14.194" - checksum: 113f34831c461469d91feca2dde737f88487732898b4d25e9eb23b087bb193985f864d1e1e0f3b777edc5022e460443588b6000a3b2348c966f72d17eedc35ea + version: 4.14.196 + resolution: "@types/lodash@npm:4.14.196" + checksum: 201d17c3e62ae02a93c99ec78e024b2be9bd75564dd8fd8c26f6ac51a985ab280d28ce2688c3bcdfe785b0991cd9814edff19ee000234c7b45d9a697f09feb6a languageName: node linkType: hard "@types/node@npm:*": - version: 20.2.1 - resolution: "@types/node@npm:20.2.1" - checksum: ed774afa6e9b4ad7868ed0182a8ca40ad0dd54815a70d3051b23fa850f3bca6bea4d0cb55e1fc769666786ac2cc4c1b37aeade313cb4c4634133f18ebcded496 + version: 20.4.8 + resolution: "@types/node@npm:20.4.8" + checksum: 86a3963c0c7af3410553d1dfa4b018a20b3cb3ab4d8e8ffe27408b6338c5de0374b0bf379bc705da2205b466daa751ccfe062f453ba9bde34fdb0e5163ca6a68 languageName: node linkType: hard @@ -1991,16 +2047,16 @@ __metadata: linkType: hard "@types/node@npm:^18.14.2": - version: 18.16.13 - resolution: "@types/node@npm:18.16.13" - checksum: ec1ffb814750fc7f7c6c7cb138ed56f24cb23a2ffe50d264a265be52b5cafca37b94b8fb3b5b420f5674baa677b0e011160aeaa1a0edd862aa4cfa11f4467918 + version: 18.17.3 + resolution: "@types/node@npm:18.17.3" + checksum: 884fb68936b2b0ff90863fcf80610dd2f3d9fe1947897248b0138df05fe41ee6ce62941b37b565e3b3fd77601cd3977a64de858654c6ab9064413b171740d6ba languageName: node linkType: hard -"@types/prettier@npm:^2, @types/prettier@npm:^2.1.5": - version: 2.7.2 - resolution: "@types/prettier@npm:2.7.2" - checksum: b47d76a5252265f8d25dd2fe2a5a61dc43ba0e6a96ffdd00c594cb4fd74c1982c2e346497e3472805d97915407a09423804cc2110a0b8e1b22cffcab246479b7 +"@types/prettier@npm:^2": + version: 2.7.3 + resolution: "@types/prettier@npm:2.7.3" + checksum: 705384209cea6d1433ff6c187c80dcc0b95d99d5c5ce21a46a9a58060c527973506822e428789d842761e0280d25e3359300f017fbe77b9755bc772ab3dc2f83 languageName: node linkType: hard @@ -2035,9 +2091,9 @@ __metadata: linkType: hard "@types/uuid@npm:^9": - version: 9.0.1 - resolution: "@types/uuid@npm:9.0.1" - checksum: c472b8a77cbeded4bc529220b8611afa39bd64677f507838f8083d8aac8033b1f88cb9ddaa2f8589e0dcd2317291d0f6e1379f82d5ceebd6f74f3b4825288e00 + version: 9.0.2 + resolution: "@types/uuid@npm:9.0.2" + checksum: 1754bcf3444e1e3aeadd6e774fc328eb53bc956665e2e8fb6ec127aa8e1f43d9a224c3d22a9a6233dca8dd81a12dc7fed4d84b8876dd5ec82d40f574f7ff8b68 languageName: node linkType: hard @@ -2076,15 +2132,15 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^5.54.0": - version: 5.59.6 - resolution: "@typescript-eslint/eslint-plugin@npm:5.59.6" + version: 5.62.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.62.0" dependencies: "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.59.6 - "@typescript-eslint/type-utils": 5.59.6 - "@typescript-eslint/utils": 5.59.6 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/type-utils": 5.62.0 + "@typescript-eslint/utils": 5.62.0 debug: ^4.3.4 - grapheme-splitter: ^1.0.4 + graphemer: ^1.4.0 ignore: ^5.2.0 natural-compare-lite: ^1.4.0 semver: ^7.3.7 @@ -2095,43 +2151,43 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: fc495b5eadc70603f0d677921a70f151ac94453ebd76b77abbf7ed213c09daf05a3e2b2e2b16139b30dc6574d068d988e4e53c017759f3d3307fa394cfd4ae39 + checksum: fc104b389c768f9fa7d45a48c86d5c1ad522c1d0512943e782a56b1e3096b2cbcc1eea3fcc590647bf0658eef61aac35120a9c6daf979bf629ad2956deb516a1 languageName: node linkType: hard "@typescript-eslint/parser@npm:^5.54.0": - version: 5.59.6 - resolution: "@typescript-eslint/parser@npm:5.59.6" + version: 5.62.0 + resolution: "@typescript-eslint/parser@npm:5.62.0" dependencies: - "@typescript-eslint/scope-manager": 5.59.6 - "@typescript-eslint/types": 5.59.6 - "@typescript-eslint/typescript-estree": 5.59.6 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 1f6e259f501e3d13f9632bd71da2cf3d11150f1276079522e8d5c392a07c3aea867c855481981fca3bf32beb6bef046ef64cdfceba8ea4150f27099e44d9a92c + checksum: d168f4c7f21a7a63f47002e2d319bcbb6173597af5c60c1cf2de046b46c76b4930a093619e69faf2d30214c29ab27b54dcf1efc7046a6a6bd6f37f59a990e752 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/scope-manager@npm:5.59.6" +"@typescript-eslint/scope-manager@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/scope-manager@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.59.6 - "@typescript-eslint/visitor-keys": 5.59.6 - checksum: 65cce7b3fc320e264ef966da9a26bb7cba014ec5a0c9c5518cb08a624d67ac6eb67dd8e2df49b33eeaaaacaf42c73f291d56f93a9d1ec82c58bd1e7e872e530b + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 + checksum: 6062d6b797fe1ce4d275bb0d17204c827494af59b5eaf09d8a78cdd39dadddb31074dded4297aaf5d0f839016d601032857698b0e4516c86a41207de606e9573 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/type-utils@npm:5.59.6" +"@typescript-eslint/type-utils@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/type-utils@npm:5.62.0" dependencies: - "@typescript-eslint/typescript-estree": 5.59.6 - "@typescript-eslint/utils": 5.59.6 + "@typescript-eslint/typescript-estree": 5.62.0 + "@typescript-eslint/utils": 5.62.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -2139,23 +2195,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: f8e09dc16f413090ec464d48bd86e1b44a569e5a6ed78370f3e8132e80a464dfcdc1525f4f0706b79e397841b1865016cb38353475264beec49851d78a7fdd36 + checksum: fc41eece5f315dfda14320be0da78d3a971d650ea41300be7196934b9715f3fe1120a80207551eb71d39568275dbbcf359bde540d1ca1439d8be15e9885d2739 languageName: node linkType: hard -"@typescript-eslint/types@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/types@npm:5.59.6" - checksum: e898ca629d95b69f5dbfb7c9a3d28f943e5a372d37bf7efaefb41341d2d7147372cd4956b35b637e9b3a1b8555d64a5b35776650b815c4227b114513247ec2b5 +"@typescript-eslint/types@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/types@npm:5.62.0" + checksum: 48c87117383d1864766486f24de34086155532b070f6264e09d0e6139449270f8a9559cfef3c56d16e3bcfb52d83d42105d61b36743626399c7c2b5e0ac3b670 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/typescript-estree@npm:5.59.6" +"@typescript-eslint/typescript-estree@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.59.6 - "@typescript-eslint/visitor-keys": 5.59.6 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/visitor-keys": 5.62.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -2164,35 +2220,35 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 65b7879e8cd4ccb987c1e1fa75cd84250cb46799ba0de6cdcaec70f6700b45ae4efcebb24163ca7946152e1b12595ee58e35bfb31ea6d35b3f39deaf973d4f1a + checksum: 3624520abb5807ed8f57b1197e61c7b1ed770c56dfcaca66372d584ff50175225798bccb701f7ef129d62c5989070e1ee3a0aa2d84e56d9524dcf011a2bb1a52 languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/utils@npm:5.59.6" +"@typescript-eslint/utils@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/utils@npm:5.62.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.59.6 - "@typescript-eslint/types": 5.59.6 - "@typescript-eslint/typescript-estree": 5.59.6 + "@typescript-eslint/scope-manager": 5.62.0 + "@typescript-eslint/types": 5.62.0 + "@typescript-eslint/typescript-estree": 5.62.0 eslint-scope: ^5.1.1 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 40ffe1d2f1fbf6c30aa05f4a68785fb1e77aa09772ea45b001daf4068e504830cf60a441a819b2c6ffe4a19216aba404869300b2ce6bc2a67d093f74ded504a7 + checksum: ee9398c8c5db6d1da09463ca7bf36ed134361e20131ea354b2da16a5fdb6df9ba70c62a388d19f6eebb421af1786dbbd79ba95ddd6ab287324fc171c3e28d931 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.59.6": - version: 5.59.6 - resolution: "@typescript-eslint/visitor-keys@npm:5.59.6" +"@typescript-eslint/visitor-keys@npm:5.62.0": + version: 5.62.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.62.0" dependencies: - "@typescript-eslint/types": 5.59.6 + "@typescript-eslint/types": 5.62.0 eslint-visitor-keys: ^3.3.0 - checksum: 8f216411344f5ed618ab838fa3fc4b04f3041f33e08d9b160df4db988f496c71f934c4b0362f686ce63ecf7f5d926c67190d5116c91945c1957544728449ec6b + checksum: 976b05d103fe8335bef5c93ad3f76d781e3ce50329c0243ee0f00c0fcfb186c81df50e64bfdd34970148113f8ade90887f53e3c4938183afba830b4ba8e30a35 languageName: node linkType: hard @@ -2224,12 +2280,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.5.0, acorn@npm:^8.8.0": - version: 8.8.2 - resolution: "acorn@npm:8.8.2" +"acorn@npm:^8.8.2, acorn@npm:^8.9.0": + version: 8.10.0 + resolution: "acorn@npm:8.10.0" bin: acorn: bin/acorn - checksum: f790b99a1bf63ef160c967e23c46feea7787e531292bb827126334612c234ed489a0dc2c7ba33156416f0ffa8d25bf2b0fdb7f35c2ba60eb3e960572bece4001 + checksum: 538ba38af0cc9e5ef983aee196c4b8b4d87c0c94532334fa7e065b2c8a1f85863467bb774231aae91613fcda5e68740c15d97b1967ae3394d20faddddd8af61d languageName: node linkType: hard @@ -2249,14 +2305,14 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.2.1": - version: 4.3.0 - resolution: "agentkeepalive@npm:4.3.0" +"agentkeepalive@npm:^4.2.1, agentkeepalive@npm:^4.3.0": + version: 4.4.0 + resolution: "agentkeepalive@npm:4.4.0" dependencies: debug: ^4.1.0 depd: ^2.0.0 humanize-ms: ^1.2.1 - checksum: 982453aa44c11a06826c836025e5162c846e1200adb56f2d075400da7d32d87021b3b0a58768d949d824811f5654223d5a8a3dad120921a2439625eb847c6260 + checksum: 36e0919a7503dacc863dc216ea6ca176c454724a63fd3d7b215089a1a2c89ee97db377b3af2454f79e5a8e7bb87e5975317734e9b0f9d5898c2269e3d8be05c7 languageName: node linkType: hard @@ -2270,7 +2326,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.10.0, ajv@npm:^6.12.4": +"ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -2298,10 +2354,17 @@ __metadata: languageName: node linkType: hard +"ansi-regex@npm:^6.0.1": + version: 6.0.1 + resolution: "ansi-regex@npm:6.0.1" + checksum: 1ff8b7667cded1de4fa2c9ae283e979fc87036864317da86a2e546725f96406746411d0d85e87a2d12fa5abd715d90006de7fa4fa0477c92321ad3b4c7d4e169 + languageName: node + linkType: hard + "ansi-sequence-parser@npm:^1.1.0": - version: 1.1.0 - resolution: "ansi-sequence-parser@npm:1.1.0" - checksum: 75f4d3a4c555655a698aec05b5763cbddcd16ccccdbfd178fb0aa471ab74fdf98e031b875ef26e64be6a95cf970c89238744b26de6e34af97f316d5186b1df53 + version: 1.1.1 + resolution: "ansi-sequence-parser@npm:1.1.1" + checksum: ead5b15c596e8e85ca02951a844366c6776769dcc9fd1bd3a0db11bb21364554822c6a439877fb599e7e1ffa0b5f039f1e5501423950457f3dcb2f480c30b188 languageName: node linkType: hard @@ -2330,6 +2393,13 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^6.1.0": + version: 6.2.1 + resolution: "ansi-styles@npm:6.2.1" + checksum: ef940f2f0ced1a6347398da88a91da7930c33ecac3c77b72c5905f8b8fe402c52e6fde304ff5347f616e27a742da3f1dc76de98f6866c69251ad0b07a66776d9 + languageName: node + linkType: hard + "anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" @@ -2410,6 +2480,19 @@ __metadata: languageName: node linkType: hard +"array.prototype.findlastindex@npm:^1.2.2": + version: 1.2.2 + resolution: "array.prototype.findlastindex@npm:1.2.2" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + get-intrinsic: ^1.1.3 + checksum: 8a166359f69a2a751c843f26b9c8cd03d0dc396a92cdcb85f4126b5f1cecdae5b2c0c616a71ea8aff026bde68165b44950b3664404bb73db0673e288495ba264 + languageName: node + linkType: hard + "array.prototype.flat@npm:^1.3.1": version: 1.3.1 resolution: "array.prototype.flat@npm:1.3.1" @@ -2434,6 +2517,39 @@ __metadata: languageName: node linkType: hard +"arraybuffer.prototype.slice@npm:^1.0.1": + version: 1.0.1 + resolution: "arraybuffer.prototype.slice@npm:1.0.1" + dependencies: + array-buffer-byte-length: ^1.0.0 + call-bind: ^1.0.2 + define-properties: ^1.2.0 + get-intrinsic: ^1.2.1 + is-array-buffer: ^3.0.2 + is-shared-array-buffer: ^1.0.2 + checksum: e3e9b2a3e988ebfeddce4c7e8f69df730c9e48cb04b0d40ff0874ce3d86b3d1339dd520ffde5e39c02610bc172ecfbd4bc93324b1cabd9554c44a56b131ce0ce + languageName: node + linkType: hard + +"asn1.js@npm:^5.2.0": + version: 5.4.1 + resolution: "asn1.js@npm:5.4.1" + dependencies: + bn.js: ^4.0.0 + inherits: ^2.0.1 + minimalistic-assert: ^1.0.0 + safer-buffer: ^2.1.0 + checksum: 3786a101ac6f304bd4e9a7df79549a7561950a13d4bcaec0c7790d44c80d147c1a94ba3d4e663673406064642a40b23fcd6c82a9952468e386c1a1376d747f9a + languageName: node + linkType: hard + +"auto-bind@npm:^5.0.1": + version: 5.0.1 + resolution: "auto-bind@npm:5.0.1" + checksum: 44a6d8d040c4382e761922f8fa1b044e18ddefbc855fecee0c76ec6b4e6fc74adda21026bc86e190833e05f52b4b6615372c2a83a734858f8395b1e2a98b253a + languageName: node + linkType: hard + "available-typed-arrays@npm:^1.0.5": version: 1.0.5 resolution: "available-typed-arrays@npm:1.0.5" @@ -2441,11 +2557,11 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^29.5.0": - version: 29.5.0 - resolution: "babel-jest@npm:29.5.0" +"babel-jest@npm:^29.6.2": + version: 29.6.2 + resolution: "babel-jest@npm:29.6.2" dependencies: - "@jest/transform": ^29.5.0 + "@jest/transform": ^29.6.2 "@types/babel__core": ^7.1.14 babel-plugin-istanbul: ^6.1.1 babel-preset-jest: ^29.5.0 @@ -2454,7 +2570,7 @@ __metadata: slash: ^3.0.0 peerDependencies: "@babel/core": ^7.8.0 - checksum: eafb6d37deb71f0c80bf3c80215aa46732153e5e8bcd73f6ff47d92e5c0c98c8f7f75995d0efec6289c371edad3693cd8fa2367b0661c4deb71a3a7117267ede + checksum: 3936b5d6ed6f08670c830ed919e38a4a593d0643b8e30fdeb16f4588b262ea5255fb96fd1849c02fba0b082ecfa4e788ce9a128ad1b9e654d46aac09c3a55504 languageName: node linkType: hard @@ -2582,13 +2698,13 @@ __metadata: linkType: hard "bin-version-check@npm:^5.0.0": - version: 5.0.0 - resolution: "bin-version-check@npm:5.0.0" + version: 5.1.0 + resolution: "bin-version-check@npm:5.1.0" dependencies: bin-version: ^6.0.0 - semver: ^7.3.5 - semver-truncate: ^2.0.0 - checksum: 1d3dc92847f8ecd5e07109f5f44727f0cb3b17c00be5ae2a2e105b86bf161bc4e5c10ee2e2c21d5d28e6382994d8416b5e06048191a485be909a1e49a959c3c3 + semver: ^7.5.3 + semver-truncate: ^3.0.0 + checksum: d99679cfe0964703045fe0145a98f117888942b621dfe2c2377305ee9a9d735374d8e3ecb3b476507b284af2567699f24f7ecb2feb1f27ad6086ad60b3198893 languageName: node linkType: hard @@ -2618,14 +2734,14 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:5.2.1, bn.js@npm:^5.0.0, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": +"bn.js@npm:5.2.1, bn.js@npm:^5.0.0, bn.js@npm:^5.1.1, bn.js@npm:^5.2.0, bn.js@npm:^5.2.1": version: 5.2.1 resolution: "bn.js@npm:5.2.1" checksum: 3dd8c8d38055fedfa95c1d5fc3c99f8dd547b36287b37768db0abab3c239711f88ff58d18d155dd8ad902b0b0cee973747b7ae20ea12a09473272b0201c9edd3 languageName: node linkType: hard -"bn.js@npm:^4.11.9": +"bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": version: 4.12.0 resolution: "bn.js@npm:4.12.0" checksum: 39afb4f15f4ea537b55eaf1446c896af28ac948fdcf47171961475724d1bb65118cca49fa6e3d67706e4790955ec0e74de584e45c8f1ef89f46c812bee5b5a12 @@ -2671,24 +2787,88 @@ __metadata: languageName: node linkType: hard -"brorand@npm:^1.1.0": +"brorand@npm:^1.0.1, brorand@npm:^1.1.0": version: 1.1.0 resolution: "brorand@npm:1.1.0" checksum: 8a05c9f3c4b46572dec6ef71012b1946db6cae8c7bb60ccd4b7dd5a84655db49fe043ecc6272e7ef1f69dc53d6730b9e2a3a03a8310509a3d797a618cbee52be languageName: node linkType: hard -"browserslist@npm:^4.21.3": - version: 4.21.5 - resolution: "browserslist@npm:4.21.5" +"browserify-aes@npm:^1.0.0, browserify-aes@npm:^1.0.4": + version: 1.2.0 + resolution: "browserify-aes@npm:1.2.0" + dependencies: + buffer-xor: ^1.0.3 + cipher-base: ^1.0.0 + create-hash: ^1.1.0 + evp_bytestokey: ^1.0.3 + inherits: ^2.0.1 + safe-buffer: ^5.0.1 + checksum: 4a17c3eb55a2aa61c934c286f34921933086bf6d67f02d4adb09fcc6f2fc93977b47d9d884c25619144fccd47b3b3a399e1ad8b3ff5a346be47270114bcf7104 + languageName: node + linkType: hard + +"browserify-cipher@npm:^1.0.0": + version: 1.0.1 + resolution: "browserify-cipher@npm:1.0.1" + dependencies: + browserify-aes: ^1.0.4 + browserify-des: ^1.0.0 + evp_bytestokey: ^1.0.0 + checksum: 2d8500acf1ee535e6bebe808f7a20e4c3a9e2ed1a6885fff1facbfd201ac013ef030422bec65ca9ece8ffe82b03ca580421463f9c45af6c8415fd629f4118c13 + languageName: node + linkType: hard + +"browserify-des@npm:^1.0.0": + version: 1.0.2 + resolution: "browserify-des@npm:1.0.2" + dependencies: + cipher-base: ^1.0.1 + des.js: ^1.0.0 + inherits: ^2.0.1 + safe-buffer: ^5.1.2 + checksum: b15a3e358a1d78a3b62ddc06c845d02afde6fc826dab23f1b9c016e643e7b1fda41de628d2110b712f6a44fb10cbc1800bc6872a03ddd363fb50768e010395b7 + languageName: node + linkType: hard + +"browserify-rsa@npm:^4.0.0, browserify-rsa@npm:^4.0.1": + version: 4.1.0 + resolution: "browserify-rsa@npm:4.1.0" + dependencies: + bn.js: ^5.0.0 + randombytes: ^2.0.1 + checksum: 155f0c135873efc85620571a33d884aa8810e40176125ad424ec9d85016ff105a07f6231650914a760cca66f29af0494087947b7be34880dd4599a0cd3c38e54 + languageName: node + linkType: hard + +"browserify-sign@npm:^4.0.0": + version: 4.2.1 + resolution: "browserify-sign@npm:4.2.1" + dependencies: + bn.js: ^5.1.1 + browserify-rsa: ^4.0.1 + create-hash: ^1.2.0 + create-hmac: ^1.1.7 + elliptic: ^6.5.3 + inherits: ^2.0.4 + parse-asn1: ^5.1.5 + readable-stream: ^3.6.0 + safe-buffer: ^5.2.0 + checksum: 0221f190e3f5b2d40183fa51621be7e838d9caa329fe1ba773406b7637855f37b30f5d83e52ff8f244ed12ffe6278dd9983638609ed88c841ce547e603855707 + languageName: node + linkType: hard + +"browserslist@npm:^4.21.9": + version: 4.21.10 + resolution: "browserslist@npm:4.21.10" dependencies: - caniuse-lite: ^1.0.30001449 - electron-to-chromium: ^1.4.284 - node-releases: ^2.0.8 - update-browserslist-db: ^1.0.10 + caniuse-lite: ^1.0.30001517 + electron-to-chromium: ^1.4.477 + node-releases: ^2.0.13 + update-browserslist-db: ^1.0.11 bin: browserslist: cli.js - checksum: 9755986b22e73a6a1497fd8797aedd88e04270be33ce66ed5d85a1c8a798292a65e222b0f251bafa1c2522261e237d73b08b58689d4920a607e5a53d56dc4706 + checksum: 1e27c0f111a35d1dd0e8fc2c61781b0daefabc2c9471b0b10537ce54843014bceb2a1ce4571af1a82b2bf1e6e6e05d38865916689a158f03bc2c7a4ec2577db8 languageName: node linkType: hard @@ -2726,6 +2906,13 @@ __metadata: languageName: node linkType: hard +"buffer-xor@npm:^1.0.3": + version: 1.0.3 + resolution: "buffer-xor@npm:1.0.3" + checksum: 10c520df29d62fa6e785e2800e586a20fc4f6dfad84bcdbd12e1e8a83856de1cb75c7ebd7abe6d036bbfab738a6cf18a3ae9c8e5a2e2eb3167ca7399ce65373a + languageName: node + linkType: hard + "buffer@npm:6.0.3, buffer@npm:~6.0.3": version: 6.0.3 resolution: "buffer@npm:6.0.3" @@ -2753,29 +2940,23 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^16.1.0": - version: 16.1.3 - resolution: "cacache@npm:16.1.3" +"cacache@npm:^17.0.0": + version: 17.1.3 + resolution: "cacache@npm:17.1.3" dependencies: - "@npmcli/fs": ^2.1.0 - "@npmcli/move-file": ^2.0.0 - chownr: ^2.0.0 - fs-minipass: ^2.1.0 - glob: ^8.0.1 - infer-owner: ^1.0.4 + "@npmcli/fs": ^3.1.0 + fs-minipass: ^3.0.0 + glob: ^10.2.2 lru-cache: ^7.7.1 - minipass: ^3.1.6 + minipass: ^5.0.0 minipass-collect: ^1.0.2 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 - mkdirp: ^1.0.4 p-map: ^4.0.0 - promise-inflight: ^1.0.1 - rimraf: ^3.0.2 - ssri: ^9.0.0 + ssri: ^10.0.0 tar: ^6.1.11 - unique-filename: ^2.0.0 - checksum: d91409e6e57d7d9a3a25e5dcc589c84e75b178ae8ea7de05cbf6b783f77a5fae938f6e8fda6f5257ed70000be27a681e1e44829251bfffe4c10216002f8f14e6 + unique-filename: ^3.0.0 + checksum: 385756781e1e21af089160d89d7462b7ed9883c978e848c7075b90b73cb823680e66092d61513050164588387d2ca87dd6d910e28d64bc13a9ac82cd8580c796 languageName: node linkType: hard @@ -2787,8 +2968,8 @@ __metadata: linkType: hard "cacheable-request@npm:^7.0.2": - version: 7.0.2 - resolution: "cacheable-request@npm:7.0.2" + version: 7.0.4 + resolution: "cacheable-request@npm:7.0.4" dependencies: clone-response: ^1.0.2 get-stream: ^5.1.0 @@ -2797,7 +2978,7 @@ __metadata: lowercase-keys: ^2.0.0 normalize-url: ^6.0.1 responselike: ^2.0.0 - checksum: 6152813982945a5c9989cb457a6c499f12edcc7ade323d2fbfd759abc860bdbd1306e08096916bb413c3c47e812f8e4c0a0cc1e112c8ce94381a960f115bc77f + checksum: 0de9df773fd4e7dd9bd118959878f8f2163867e2e1ab3575ffbecbe6e75e80513dd0c68ba30005e5e5a7b377cc6162bbc00ab1db019bb4e9cb3c2f3f7a6f1ee4 languageName: node linkType: hard @@ -2832,10 +3013,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.30001449": - version: 1.0.30001488 - resolution: "caniuse-lite@npm:1.0.30001488" - checksum: ef0caf2914f9fca700b75d22921f500241f4e988ded9985e62737136031787052185d8136a65a3a6d6d12b559cf75ab99f5488931f8bd060f1b7810a2c1ee1d1 +"caniuse-lite@npm:^1.0.30001517": + version: 1.0.30001519 + resolution: "caniuse-lite@npm:1.0.30001519" + checksum: 66085133ede05d947e30b62fed2cbae18e5767afda8b0de38840883e1cfe5846bf1568ddbafd31647544e59112355abedaf9c867ac34541bfc20d69e7a19d94c languageName: node linkType: hard @@ -2914,10 +3095,20 @@ __metadata: languageName: node linkType: hard +"cipher-base@npm:^1.0.0, cipher-base@npm:^1.0.1, cipher-base@npm:^1.0.3": + version: 1.0.4 + resolution: "cipher-base@npm:1.0.4" + dependencies: + inherits: ^2.0.1 + safe-buffer: ^5.0.1 + checksum: 47d3568dbc17431a339bad1fe7dff83ac0891be8206911ace3d3b818fc695f376df809bea406e759cdea07fff4b454fa25f1013e648851bec790c1d75763032e + languageName: node + linkType: hard + "cjs-module-lexer@npm:^1.0.0": - version: 1.2.2 - resolution: "cjs-module-lexer@npm:1.2.2" - checksum: 977f3f042bd4f08e368c890d91eecfbc4f91da0bc009a3c557bc4dfbf32022ad1141244ac1178d44de70fc9f3dea7add7cd9a658a34b9fae98a55d8f92331ce5 + version: 1.2.3 + resolution: "cjs-module-lexer@npm:1.2.3" + checksum: 5ea3cb867a9bb609b6d476cd86590d105f3cfd6514db38ff71f63992ab40939c2feb68967faa15a6d2b1f90daa6416b79ea2de486e9e2485a6f8b66a21b4fb0a languageName: node linkType: hard @@ -2956,9 +3147,9 @@ __metadata: linkType: hard "collect-v8-coverage@npm:^1.0.0": - version: 1.0.1 - resolution: "collect-v8-coverage@npm:1.0.1" - checksum: 4efe0a1fccd517b65478a2364b33dadd0a43fc92a56f59aaece9b6186fe5177b2de471253587de7c91516f07c7268c2f6770b6cbcffc0e0ece353b766ec87e55 + version: 1.0.2 + resolution: "collect-v8-coverage@npm:1.0.2" + checksum: c10f41c39ab84629d16f9f6137bc8a63d332244383fc368caf2d2052b5e04c20cd1fd70f66fcf4e2422b84c8226598b776d39d5f2d2a51867cc1ed5d1982b4da languageName: node linkType: hard @@ -3068,6 +3259,43 @@ __metadata: languageName: node linkType: hard +"create-ecdh@npm:^4.0.0": + version: 4.0.4 + resolution: "create-ecdh@npm:4.0.4" + dependencies: + bn.js: ^4.1.0 + elliptic: ^6.5.3 + checksum: 0dd7fca9711d09e152375b79acf1e3f306d1a25ba87b8ff14c2fd8e68b83aafe0a7dd6c4e540c9ffbdd227a5fa1ad9b81eca1f233c38bb47770597ba247e614b + languageName: node + linkType: hard + +"create-hash@npm:^1.1.0, create-hash@npm:^1.1.2, create-hash@npm:^1.2.0": + version: 1.2.0 + resolution: "create-hash@npm:1.2.0" + dependencies: + cipher-base: ^1.0.1 + inherits: ^2.0.1 + md5.js: ^1.3.4 + ripemd160: ^2.0.1 + sha.js: ^2.4.0 + checksum: 02a6ae3bb9cd4afee3fabd846c1d8426a0e6b495560a977ba46120c473cb283be6aa1cace76b5f927cf4e499c6146fb798253e48e83d522feba807d6b722eaa9 + languageName: node + linkType: hard + +"create-hmac@npm:^1.1.0, create-hmac@npm:^1.1.4, create-hmac@npm:^1.1.7": + version: 1.1.7 + resolution: "create-hmac@npm:1.1.7" + dependencies: + cipher-base: ^1.0.3 + create-hash: ^1.1.0 + inherits: ^2.0.1 + ripemd160: ^2.0.0 + safe-buffer: ^5.0.1 + sha.js: ^2.4.8 + checksum: ba12bb2257b585a0396108c72830e85f882ab659c3320c83584b1037f8ab72415095167ced80dc4ce8e446a8ecc4b2acf36d87befe0707d73b26cf9dc77440ed + languageName: node + linkType: hard + "cross-spawn@npm:^5.0.1": version: 5.1.0 resolution: "cross-spawn@npm:5.1.0" @@ -3079,7 +3307,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -3090,10 +3318,36 @@ __metadata: languageName: node linkType: hard +"crypto-browserify@npm:^3.12.0": + version: 3.12.0 + resolution: "crypto-browserify@npm:3.12.0" + dependencies: + browserify-cipher: ^1.0.0 + browserify-sign: ^4.0.0 + create-ecdh: ^4.0.0 + create-hash: ^1.1.0 + create-hmac: ^1.1.0 + diffie-hellman: ^5.0.0 + inherits: ^2.0.1 + pbkdf2: ^3.0.3 + public-encrypt: ^4.0.0 + randombytes: ^2.0.0 + randomfill: ^1.0.3 + checksum: c1609af82605474262f3eaa07daa0b2140026bd264ab316d4bf1170272570dbe02f0c49e29407fe0d3634f96c507c27a19a6765fb856fed854a625f9d15618e2 + languageName: node + linkType: hard + +"crypto@npm:^1.0.1": + version: 1.0.1 + resolution: "crypto@npm:1.0.1" + checksum: 087fe3165bd94c333a49e6ed66a0193911f63eac38a24f379b3001a5fe260a59c413646e53a0f67875ba13902b2686d81dc703cb2c147a4ec727dcdc04e5645e + languageName: node + linkType: hard + "dayjs@npm:^1.11.7": - version: 1.11.7 - resolution: "dayjs@npm:1.11.7" - checksum: 5003a7c1dd9ed51385beb658231c3548700b82d3548c0cfbe549d85f2d08e90e972510282b7506941452c58d32136d6362f009c77ca55381a09c704e9f177ebb + version: 1.11.9 + resolution: "dayjs@npm:1.11.9" + checksum: a4844d83dc87f921348bb9b1b93af851c51e6f71fa259604809cfe1b49d1230e6b0212dab44d1cb01994c096ad3a77ea1cf18fa55154da6efcc9d3610526ac38 languageName: node linkType: hard @@ -3127,10 +3381,15 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^0.7.0": - version: 0.7.0 - resolution: "dedent@npm:0.7.0" - checksum: 87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 +"dedent@npm:^1.0.0": + version: 1.5.1 + resolution: "dedent@npm:1.5.1" + peerDependencies: + babel-plugin-macros: ^3.1.0 + peerDependenciesMeta: + babel-plugin-macros: + optional: true + checksum: c3c300a14edf1bdf5a873f9e4b22e839d62490bc5c8d6169c1f15858a1a76733d06a9a56930e963d677a2ceeca4b6b0894cc5ea2f501aa382ca5b92af3413c2a languageName: node linkType: hard @@ -3193,6 +3452,16 @@ __metadata: languageName: node linkType: hard +"des.js@npm:^1.0.0": + version: 1.1.0 + resolution: "des.js@npm:1.1.0" + dependencies: + inherits: ^2.0.1 + minimalistic-assert: ^1.0.0 + checksum: 0e9c1584b70d31e20f20a613fc9ef60fbc6a147dfec9e448a168794a4b97ac04d8dc47ea008f1fa93b0f8aaf7c1ead632a5e59ce1913a6079d2d244c9f5ebe33 + languageName: node + linkType: hard + "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -3207,6 +3476,17 @@ __metadata: languageName: node linkType: hard +"diffie-hellman@npm:^5.0.0": + version: 5.0.3 + resolution: "diffie-hellman@npm:5.0.3" + dependencies: + bn.js: ^4.1.0 + miller-rabin: ^4.0.0 + randombytes: ^2.0.0 + checksum: 0e620f322170c41076e70181dd1c24e23b08b47dbb92a22a644f3b89b6d3834b0f8ee19e37916164e5eb1ee26d2aa836d6129f92723995267250a0b541811065 + languageName: node + linkType: hard + "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -3234,14 +3514,21 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.284": - version: 1.4.399 - resolution: "electron-to-chromium@npm:1.4.399" - checksum: 51995e6e4dd6d2f630d56b21bd0ae47d8078dc7414b9648e644ba11fad99631da742ffd7a0f8af0abcb0bdb1749a678f95c87ead9b604fbc4625395b4236c94a +"eastasianwidth@npm:^0.2.0": + version: 0.2.0 + resolution: "eastasianwidth@npm:0.2.0" + checksum: 7d00d7cd8e49b9afa762a813faac332dee781932d6f2c848dc348939c4253f1d4564341b7af1d041853bc3f32c2ef141b58e0a4d9862c17a7f08f68df1e0f1ed + languageName: node + linkType: hard + +"electron-to-chromium@npm:^1.4.477": + version: 1.4.485 + resolution: "electron-to-chromium@npm:1.4.485" + checksum: 6f9efc92c18c4c8a16ba6d6004823d7ec893b98a0a0eae372e8cf1fbb61bdd04b9e2edd692dcb2e9d59cec06e3ef899262c52f1eb1e5d0202ee3d0b594fb4bd2 languageName: node linkType: hard -"elliptic@npm:6.5.4": +"elliptic@npm:6.5.4, elliptic@npm:^6.5.3": version: 6.5.4 resolution: "elliptic@npm:6.5.4" dependencies: @@ -3270,6 +3557,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^9.2.2": + version: 9.2.2 + resolution: "emoji-regex@npm:9.2.2" + checksum: 8487182da74aabd810ac6d6f1994111dfc0e331b01271ae01ec1eb0ad7b5ecc2bbbbd2f053c05cb55a1ac30449527d819bbfbf0e3de1023db308cbcb47f86601 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -3322,17 +3616,18 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.19.0, es-abstract@npm:^1.20.4": - version: 1.21.2 - resolution: "es-abstract@npm:1.21.2" +"es-abstract@npm:^1.19.0, es-abstract@npm:^1.20.4, es-abstract@npm:^1.21.2": + version: 1.22.1 + resolution: "es-abstract@npm:1.22.1" dependencies: array-buffer-byte-length: ^1.0.0 + arraybuffer.prototype.slice: ^1.0.1 available-typed-arrays: ^1.0.5 call-bind: ^1.0.2 es-set-tostringtag: ^2.0.1 es-to-primitive: ^1.2.1 function.prototype.name: ^1.1.5 - get-intrinsic: ^1.2.0 + get-intrinsic: ^1.2.1 get-symbol-description: ^1.0.0 globalthis: ^1.0.3 gopd: ^1.0.1 @@ -3352,15 +3647,19 @@ __metadata: object-inspect: ^1.12.3 object-keys: ^1.1.1 object.assign: ^4.1.4 - regexp.prototype.flags: ^1.4.3 + regexp.prototype.flags: ^1.5.0 + safe-array-concat: ^1.0.0 safe-regex-test: ^1.0.0 string.prototype.trim: ^1.2.7 string.prototype.trimend: ^1.0.6 string.prototype.trimstart: ^1.0.6 + typed-array-buffer: ^1.0.0 + typed-array-byte-length: ^1.0.0 + typed-array-byte-offset: ^1.0.0 typed-array-length: ^1.0.4 unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.9 - checksum: 037f55ee5e1cdf2e5edbab5524095a4f97144d95b94ea29e3611b77d852fd8c8a40e7ae7101fa6a759a9b9b1405f188c3c70928f2d3cd88d543a07fc0d5ad41a + which-typed-array: ^1.1.10 + checksum: 614e2c1c3717cb8d30b6128ef12ea110e06fd7d75ad77091ca1c5dbfb00da130e62e4bbbbbdda190eada098a22b27fe0f99ae5a1171dac2c8663b1e8be8a3a9b languageName: node linkType: hard @@ -3447,28 +3746,28 @@ __metadata: linkType: hard "eslint-config-prettier@npm:^8.6.0": - version: 8.8.0 - resolution: "eslint-config-prettier@npm:8.8.0" + version: 8.10.0 + resolution: "eslint-config-prettier@npm:8.10.0" peerDependencies: eslint: ">=7.0.0" bin: eslint-config-prettier: bin/cli.js - checksum: 1e94c3882c4d5e41e1dcfa2c368dbccbfe3134f6ac7d40101644d3bfbe3eb2f2ffac757f3145910b5eacf20c0e85e02b91293d3126d770cbf3dc390b3564681c + checksum: 153266badd477e49b0759816246b2132f1dbdb6c7f313ca60a9af5822fd1071c2bc5684a3720d78b725452bbac04bb130878b2513aea5e72b1b792de5a69fec8 languageName: node linkType: hard "eslint-import-resolver-node@npm:^0.3.7": - version: 0.3.7 - resolution: "eslint-import-resolver-node@npm:0.3.7" + version: 0.3.8 + resolution: "eslint-import-resolver-node@npm:0.3.8" dependencies: debug: ^3.2.7 - is-core-module: ^2.11.0 - resolve: ^1.22.1 - checksum: 3379aacf1d2c6952c1b9666c6fa5982c3023df695430b0d391c0029f6403a7775414873d90f397e98ba6245372b6c8960e16e74d9e4a3b0c0a4582f3bdbe3d6e + is-core-module: ^2.13.0 + resolve: ^1.22.4 + checksum: 5769ebec976d1145957f5d87ee05b6e880cd3fbeb001a43b7a6e6a03b303d9b253b37ca296277f228159a0bbb690638c2e4b3a573dd4d6753b8f28ff85dbe192 languageName: node linkType: hard -"eslint-module-utils@npm:^2.7.4": +"eslint-module-utils@npm:^2.8.0": version: 2.8.0 resolution: "eslint-module-utils@npm:2.8.0" dependencies: @@ -3481,27 +3780,30 @@ __metadata: linkType: hard "eslint-plugin-import@npm:^2.27.5": - version: 2.27.5 - resolution: "eslint-plugin-import@npm:2.27.5" + version: 2.28.0 + resolution: "eslint-plugin-import@npm:2.28.0" dependencies: array-includes: ^3.1.6 + array.prototype.findlastindex: ^1.2.2 array.prototype.flat: ^1.3.1 array.prototype.flatmap: ^1.3.1 debug: ^3.2.7 doctrine: ^2.1.0 eslint-import-resolver-node: ^0.3.7 - eslint-module-utils: ^2.7.4 + eslint-module-utils: ^2.8.0 has: ^1.0.3 - is-core-module: ^2.11.0 + is-core-module: ^2.12.1 is-glob: ^4.0.3 minimatch: ^3.1.2 + object.fromentries: ^2.0.6 + object.groupby: ^1.0.0 object.values: ^1.1.6 - resolve: ^1.22.1 - semver: ^6.3.0 - tsconfig-paths: ^3.14.1 + resolve: ^1.22.3 + semver: ^6.3.1 + tsconfig-paths: ^3.14.2 peerDependencies: eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - checksum: f500571a380167e25d72a4d925ef9a7aae8899eada57653e5f3051ec3d3c16d08271fcefe41a30a9a2f4fefc232f066253673ee4ea77b30dba65ae173dade85d + checksum: f9eba311b93ca1bb89311856b1f7285bd79e0181d7eb70fe115053ff77e2235fea749b30f538b78927dc65769340b5be61f4c9581d1c82bcdcccb2061f440ad1 languageName: node linkType: hard @@ -3539,43 +3841,43 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.0": - version: 7.2.0 - resolution: "eslint-scope@npm:7.2.0" +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: 64591a2d8b244ade9c690b59ef238a11d5c721a98bcee9e9f445454f442d03d3e04eda88e95a4daec558220a99fa384309d9faae3d459bd40e7a81b4063980ae + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1": - version: 3.4.1 - resolution: "eslint-visitor-keys@npm:3.4.1" - checksum: f05121d868202736b97de7d750847a328fcfa8593b031c95ea89425333db59676ac087fa905eba438d0a3c5769632f828187e0c1a0d271832a2153c1d3661c2c +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.2": + version: 3.4.2 + resolution: "eslint-visitor-keys@npm:3.4.2" + checksum: 9e0e7e4aaea705c097ae37c97410e5f167d4d2193be2edcb1f0760762ede3df01545e4820ae314f42dcec687745f2c6dcaf6d83575c4a2a241eb0c8517d724f2 languageName: node linkType: hard "eslint@npm:^8.35.0": - version: 8.40.0 - resolution: "eslint@npm:8.40.0" + version: 8.46.0 + resolution: "eslint@npm:8.46.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.0.3 - "@eslint/js": 8.40.0 - "@humanwhocodes/config-array": ^0.11.8 + "@eslint-community/regexpp": ^4.6.1 + "@eslint/eslintrc": ^2.1.1 + "@eslint/js": ^8.46.0 + "@humanwhocodes/config-array": ^0.11.10 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.10.0 + ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.0 - eslint-visitor-keys: ^3.4.1 - espree: ^9.5.2 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.2 + espree: ^9.6.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 @@ -3583,37 +3885,34 @@ __metadata: find-up: ^5.0.0 glob-parent: ^6.0.2 globals: ^13.19.0 - grapheme-splitter: ^1.0.4 + graphemer: ^1.4.0 ignore: ^5.2.0 - import-fresh: ^3.0.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 is-path-inside: ^3.0.3 - js-sdsl: ^4.1.4 js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 lodash.merge: ^4.6.2 minimatch: ^3.1.2 natural-compare: ^1.4.0 - optionator: ^0.9.1 + optionator: ^0.9.3 strip-ansi: ^6.0.1 - strip-json-comments: ^3.1.0 text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: b79eba37f52f517a420eec99a80ae9f284d2cbe73afc0d4d3d4d5ed1cce0b06f21badc0374bfb7ac239efd2d49a1fd7c6111d6c3d52888521f377ba33de77e61 + checksum: 7a7d36b1a3bbc12e08fbb5bc36fd482a7a5a1797e62e762499dd45601b9e45aaa53a129f31ce0b4444551a9639b8b681ad535f379893dd1e3ae37b31dccd82aa languageName: node linkType: hard -"espree@npm:^9.5.2": - version: 9.5.2 - resolution: "espree@npm:9.5.2" +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: - acorn: ^8.8.0 + acorn: ^8.9.0 acorn-jsx: ^5.3.2 eslint-visitor-keys: ^3.4.1 - checksum: 6506289d6eb26471c0b383ee24fee5c8ae9d61ad540be956b3127be5ce3bf687d2ba6538ee5a86769812c7c552a9d8239e8c4d150f9ea056c6d5cbe8399c03c1 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 languageName: node linkType: hard @@ -3718,6 +4017,17 @@ __metadata: languageName: node linkType: hard +"evp_bytestokey@npm:^1.0.0, evp_bytestokey@npm:^1.0.3": + version: 1.0.3 + resolution: "evp_bytestokey@npm:1.0.3" + dependencies: + md5.js: ^1.3.4 + node-gyp: latest + safe-buffer: ^5.1.1 + checksum: ad4e1577f1a6b721c7800dcc7c733fe01f6c310732bb5bf2240245c2a5b45a38518b91d8be2c610611623160b9d1c0e91f1ce96d639f8b53e8894625cf20fa45 + languageName: node + linkType: hard + "execa@npm:^0.7.0": version: 0.7.0 resolution: "execa@npm:0.7.0" @@ -3781,16 +4091,24 @@ __metadata: languageName: node linkType: hard -"expect@npm:^29.0.0, expect@npm:^29.5.0": - version: 29.5.0 - resolution: "expect@npm:29.5.0" +"expect@npm:^29.0.0, expect@npm:^29.6.2": + version: 29.6.2 + resolution: "expect@npm:29.6.2" dependencies: - "@jest/expect-utils": ^29.5.0 + "@jest/expect-utils": ^29.6.2 + "@types/node": "*" jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.5.0 - jest-message-util: ^29.5.0 - jest-util: ^29.5.0 - checksum: 58f70b38693df6e5c6892db1bcd050f0e518d6f785175dc53917d4fa6a7359a048e5690e19ddcb96b65c4493881dd89a3dabdab1a84dfa55c10cdbdabf37b2d7 + jest-matcher-utils: ^29.6.2 + jest-message-util: ^29.6.2 + jest-util: ^29.6.2 + checksum: 71f7b0c560e58bf6d27e0fded261d4bdb7ef81552a6bb4bd1ee09ce7a1f7dca67fbf83cf9b07a6645a88ef52e65085a0dcbe17f6c063b53ff7c2f0f3ea4ef69e + languageName: node + linkType: hard + +"exponential-backoff@npm:^3.1.1": + version: 3.1.1 + resolution: "exponential-backoff@npm:3.1.1" + checksum: 3d21519a4f8207c99f7457287291316306255a328770d320b401114ec8481986e4e467e854cb9914dd965e0a1ca810a23ccb559c642c88f4c7f55c55778a9b48 languageName: node linkType: hard @@ -3828,22 +4146,22 @@ __metadata: linkType: hard "fast-diff@npm:^1.1.2": - version: 1.2.0 - resolution: "fast-diff@npm:1.2.0" - checksum: 1b5306eaa9e826564d9e5ffcd6ebd881eb5f770b3f977fcbf38f05c824e42172b53c79920e8429c54eb742ce15a0caf268b0fdd5b38f6de52234c4a8368131ae + version: 1.3.0 + resolution: "fast-diff@npm:1.3.0" + checksum: d22d371b994fdc8cce9ff510d7b8dc4da70ac327bcba20df607dd5b9cae9f908f4d1028f5fe467650f058d1e7270235ae0b8230809a262b4df587a3b3aa216c3 languageName: node linkType: hard "fast-glob@npm:^3.2.5, fast-glob@npm:^3.2.9": - version: 3.2.12 - resolution: "fast-glob@npm:3.2.12" + version: 3.3.1 + resolution: "fast-glob@npm:3.3.1" dependencies: "@nodelib/fs.stat": ^2.0.2 "@nodelib/fs.walk": ^1.2.3 glob-parent: ^5.1.2 merge2: ^1.3.0 micromatch: ^4.0.4 - checksum: 0b1990f6ce831c7e28c4d505edcdaad8e27e88ab9fa65eedadb730438cfc7cde4910d6c975d6b7b8dc8a73da4773702ebcfcd6e3518e73938bb1383badfe01c2 + checksum: b6f3add6403e02cf3a798bfbb1183d0f6da2afd368f27456010c0bc1f9640aea308243d4cb2c0ab142f618276e65ecb8be1661d7c62a7b4e5ba774b9ce5432e5 languageName: node linkType: hard @@ -3995,7 +4313,17 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": +"foreground-child@npm:^3.1.0": + version: 3.1.1 + resolution: "foreground-child@npm:3.1.1" + dependencies: + cross-spawn: ^7.0.0 + signal-exit: ^4.0.1 + checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 + languageName: node + linkType: hard + +"fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -4004,6 +4332,15 @@ __metadata: languageName: node linkType: hard +"fs-minipass@npm:^3.0.0": + version: 3.0.2 + resolution: "fs-minipass@npm:3.0.2" + dependencies: + minipass: ^5.0.0 + checksum: e9cc0e1f2d01c6f6f62f567aee59530aba65c6c7b2ae88c5027bc34c711ebcfcfaefd0caf254afa6adfe7d1fba16bc2537508a6235196bac7276747d078aef0a + languageName: node + linkType: hard + "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -4086,7 +4423,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0": +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1": version: 1.2.1 resolution: "get-intrinsic@npm:1.2.1" dependencies: @@ -4156,6 +4493,21 @@ __metadata: languageName: node linkType: hard +"glob@npm:^10.2.2": + version: 10.3.3 + resolution: "glob@npm:10.3.3" + dependencies: + foreground-child: ^3.1.0 + jackspeak: ^2.0.3 + minimatch: ^9.0.1 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + path-scurry: ^1.10.1 + bin: + glob: dist/cjs/src/bin.js + checksum: 29190d3291f422da0cb40b77a72fc8d2c51a36524e99b8bf412548b7676a6627489528b57250429612b6eec2e6fe7826d328451d3e694a9d15e575389308ec53 + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -4170,7 +4522,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1, glob@npm:^8.0.3": +"glob@npm:^8.0.3": version: 8.1.0 resolution: "glob@npm:8.1.0" dependencies: @@ -4257,10 +4609,26 @@ __metadata: languageName: node linkType: hard -"grapheme-splitter@npm:^1.0.4": - version: 1.0.4 - resolution: "grapheme-splitter@npm:1.0.4" - checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620 +"graphemer@npm:^1.4.0": + version: 1.4.0 + resolution: "graphemer@npm:1.4.0" + checksum: bab8f0be9b568857c7bec9fda95a89f87b783546d02951c40c33f84d05bb7da3fd10f863a9beb901463669b6583173a8c8cc6d6b306ea2b9b9d5d3d943c3a673 + languageName: node + linkType: hard + +"graphql-ws@npm:^5.11.3": + version: 5.14.0 + resolution: "graphql-ws@npm:5.14.0" + peerDependencies: + graphql: ">=0.11 <=16" + checksum: 7b622944823fa12a77ea490656121a77e1a1daf08114a6a0b027922113f4481d95f4fe380a5de369a51657ef777d35757dc31f63e41071c21f3e97ca47e4205a + languageName: node + linkType: hard + +"graphql@npm:^16.6.0": + version: 16.7.1 + resolution: "graphql@npm:16.7.1" + checksum: c924d8428daf0e96a5ea43e9bc3cd1b6802899907d284478ac8f705c8fd233a0a51eef915f7569fb5de8acb2e85b802ccc6c85c2b157ad805c1e9adba5a299bd languageName: node linkType: hard @@ -4333,6 +4701,17 @@ __metadata: languageName: node linkType: hard +"hash-base@npm:^3.0.0": + version: 3.1.0 + resolution: "hash-base@npm:3.1.0" + dependencies: + inherits: ^2.0.4 + readable-stream: ^3.6.0 + safe-buffer: ^5.2.0 + checksum: 26b7e97ac3de13cb23fc3145e7e3450b0530274a9562144fc2bf5c1e2983afd0e09ed7cc3b20974ba66039fad316db463da80eb452e7373e780cbee9a0d2f2dc + languageName: node + linkType: hard + "hash.js@npm:1.1.7, hash.js@npm:^1.0.0, hash.js@npm:^1.0.3": version: 1.1.7 resolution: "hash.js@npm:1.1.7" @@ -4361,7 +4740,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.0": +"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 @@ -4451,7 +4830,7 @@ __metadata: languageName: node linkType: hard -"import-fresh@npm:^3.0.0, import-fresh@npm:^3.2.1": +"import-fresh@npm:^3.2.1": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" dependencies: @@ -4487,13 +4866,6 @@ __metadata: languageName: node linkType: hard -"infer-owner@npm:^1.0.4": - version: 1.0.4 - resolution: "infer-owner@npm:1.0.4" - checksum: 181e732764e4a0611576466b4b87dac338972b839920b2a8cde43642e4ed6bd54dc1fb0b40874728f2a2df9a1b097b8ff83b56d5f8f8e3927f837fdcb47d8a89 - languageName: node - linkType: hard - "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -4504,7 +4876,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.3, inherits@npm:^2.0.4": +"inherits@npm:2, inherits@npm:2.0.4, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:^2.0.4": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -4602,12 +4974,12 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.0": - version: 2.12.1 - resolution: "is-core-module@npm:2.12.1" +"is-core-module@npm:^2.12.1, is-core-module@npm:^2.13.0": + version: 2.13.0 + resolution: "is-core-module@npm:2.13.0" dependencies: has: ^1.0.3 - checksum: f04ea30533b5e62764e7b2e049d3157dc0abd95ef44275b32489ea2081176ac9746ffb1cdb107445cf1ff0e0dfcad522726ca27c27ece64dadf3795428b8e468 + checksum: 053ab101fb390bfeb2333360fd131387bed54e476b26860dc7f5a700bbf34a0ec4454f7c8c4d43e8a0030957e4b3db6e16d35e1890ea6fb654c833095e040355 languageName: node linkType: hard @@ -4701,6 +5073,13 @@ __metadata: languageName: node linkType: hard +"is-plain-obj@npm:^2.1.0": + version: 2.1.0 + resolution: "is-plain-obj@npm:2.1.0" + checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa + languageName: node + linkType: hard + "is-reference@npm:1.2.1": version: 1.2.1 resolution: "is-reference@npm:1.2.1" @@ -4762,15 +5141,11 @@ __metadata: linkType: hard "is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.9": - version: 1.1.10 - resolution: "is-typed-array@npm:1.1.10" + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: aac6ecb59d4c56a1cdeb69b1f129154ef462bbffe434cb8a8235ca89b42f258b7ae94073c41b3cb7bce37f6a1733ad4499f07882d5d5093a7ba84dfc4ebb8017 + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 languageName: node linkType: hard @@ -4783,6 +5158,13 @@ __metadata: languageName: node linkType: hard +"isarray@npm:^2.0.5": + version: 2.0.5 + resolution: "isarray@npm:2.0.5" + checksum: bd5bbe4104438c4196ba58a54650116007fa0262eccef13a4c55b2e09a5b36b59f1e75b9fcc49883dd9d4953892e6fc007eef9e9155648ceea036e184b0f930a + languageName: node + linkType: hard + "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -4820,13 +5202,13 @@ __metadata: linkType: hard "istanbul-lib-report@npm:^3.0.0": - version: 3.0.0 - resolution: "istanbul-lib-report@npm:3.0.0" + version: 3.0.1 + resolution: "istanbul-lib-report@npm:3.0.1" dependencies: istanbul-lib-coverage: ^3.0.0 - make-dir: ^3.0.0 + make-dir: ^4.0.0 supports-color: ^7.1.0 - checksum: 3f29eb3f53c59b987386e07fe772d24c7f58c6897f34c9d7a296f4000de7ae3de9eb95c3de3df91dc65b134c84dee35c54eee572a56243e8907c48064e34ff1b + checksum: fd17a1b879e7faf9bb1dc8f80b2a16e9f5b7b8498fe6ed580a618c34df0bfe53d2abd35bf8a0a00e628fb7405462576427c7df20bbe4148d19c14b431c974b21 languageName: node linkType: hard @@ -4842,18 +5224,31 @@ __metadata: linkType: hard "istanbul-reports@npm:^3.1.3": - version: 3.1.5 - resolution: "istanbul-reports@npm:3.1.5" + version: 3.1.6 + resolution: "istanbul-reports@npm:3.1.6" dependencies: html-escaper: ^2.0.0 istanbul-lib-report: ^3.0.0 - checksum: 7867228f83ed39477b188ea07e7ccb9b4f5320b6f73d1db93a0981b7414fa4ef72d3f80c4692c442f90fc250d9406e71d8d7ab65bb615cb334e6292b73192b89 + checksum: 44c4c0582f287f02341e9720997f9e82c071627e1e862895745d5f52ec72c9b9f38e1d12370015d2a71dcead794f34c7732aaef3fab80a24bc617a21c3d911d6 languageName: node linkType: hard -"jayson@npm:^3.4.4": - version: 3.7.0 - resolution: "jayson@npm:3.7.0" +"jackspeak@npm:^2.0.3": + version: 2.2.2 + resolution: "jackspeak@npm:2.2.2" + dependencies: + "@isaacs/cliui": ^8.0.2 + "@pkgjs/parseargs": ^0.11.0 + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 7b1468dd910afc00642db87448f24b062346570b8b47531409aa9012bcb95fdf7ec2b1c48edbb8b57a938c08391f8cc01b5034fc335aa3a2e74dbcc0ee5c555a + languageName: node + linkType: hard + +"jayson@npm:^4.1.0": + version: 4.1.0 + resolution: "jayson@npm:4.1.0" dependencies: "@types/connect": ^3.4.33 "@types/node": ^12.12.54 @@ -4865,12 +5260,11 @@ __metadata: eyes: ^0.1.8 isomorphic-ws: ^4.0.1 json-stringify-safe: ^5.0.1 - lodash: ^4.17.20 uuid: ^8.3.2 ws: ^7.4.5 bin: jayson: bin/jayson.js - checksum: 4218a4829168a4927e657bde953ff9699f02af561ec72edcc7464446772b50a0c5c7e9f11d4ee5976e4794d0f1040c0f351a0fee51c542bf8492743d30b7a971 + checksum: 86464322fbdc6db65d2bb4fc278cb6c86fad5c2a506065490d39459f09ba0d30f2b4fb740b33828a1424791419b6c8bd295dc54d361a4ad959bf70cc62b1ca7e languageName: node linkType: hard @@ -4884,48 +5278,48 @@ __metadata: languageName: node linkType: hard -"jest-circus@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-circus@npm:29.5.0" +"jest-circus@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-circus@npm:29.6.2" dependencies: - "@jest/environment": ^29.5.0 - "@jest/expect": ^29.5.0 - "@jest/test-result": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/environment": ^29.6.2 + "@jest/expect": ^29.6.2 + "@jest/test-result": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" chalk: ^4.0.0 co: ^4.6.0 - dedent: ^0.7.0 + dedent: ^1.0.0 is-generator-fn: ^2.0.0 - jest-each: ^29.5.0 - jest-matcher-utils: ^29.5.0 - jest-message-util: ^29.5.0 - jest-runtime: ^29.5.0 - jest-snapshot: ^29.5.0 - jest-util: ^29.5.0 + jest-each: ^29.6.2 + jest-matcher-utils: ^29.6.2 + jest-message-util: ^29.6.2 + jest-runtime: ^29.6.2 + jest-snapshot: ^29.6.2 + jest-util: ^29.6.2 p-limit: ^3.1.0 - pretty-format: ^29.5.0 + pretty-format: ^29.6.2 pure-rand: ^6.0.0 slash: ^3.0.0 stack-utils: ^2.0.3 - checksum: 44ff5d06acedae6de6c866e20e3b61f83e29ab94cf9f960826e7e667de49c12dd9ab9dffd7fa3b7d1f9688a8b5bfb1ebebadbea69d9ed0d3f66af4a0ff8c2b27 + checksum: 4f5a96a68c3c808c3d5a9279a2f39a2937386e2cebba5096971f267d79562ce2133a13bc05356a39f8f1ba68fcfe1eb39c4572b3fb0f91affbd932950e89c1e3 languageName: node linkType: hard -"jest-cli@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-cli@npm:29.5.0" +"jest-cli@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-cli@npm:29.6.2" dependencies: - "@jest/core": ^29.5.0 - "@jest/test-result": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/core": ^29.6.2 + "@jest/test-result": ^29.6.2 + "@jest/types": ^29.6.1 chalk: ^4.0.0 exit: ^0.1.2 graceful-fs: ^4.2.9 import-local: ^3.0.2 - jest-config: ^29.5.0 - jest-util: ^29.5.0 - jest-validate: ^29.5.0 + jest-config: ^29.6.2 + jest-util: ^29.6.2 + jest-validate: ^29.6.2 prompts: ^2.0.1 yargs: ^17.3.1 peerDependencies: @@ -4935,34 +5329,34 @@ __metadata: optional: true bin: jest: bin/jest.js - checksum: 39897bbbc0f0d8a6b975ab12fd13887eaa28d92e3dee9e0173a5cb913ae8cc2ae46e090d38c6d723e84d9d6724429cd08685b4e505fa447d31ca615630c7dbba + checksum: 0b7b09ae4bd327caf1981eac5a14679ddda3c5c836c9f8ea0ecfe1e5e10e9a39a5ed783fa38d25383604c4d3405595e74b391d955e99aea7e51acb41a59ea108 languageName: node linkType: hard -"jest-config@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-config@npm:29.5.0" +"jest-config@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-config@npm:29.6.2" dependencies: "@babel/core": ^7.11.6 - "@jest/test-sequencer": ^29.5.0 - "@jest/types": ^29.5.0 - babel-jest: ^29.5.0 + "@jest/test-sequencer": ^29.6.2 + "@jest/types": ^29.6.1 + babel-jest: ^29.6.2 chalk: ^4.0.0 ci-info: ^3.2.0 deepmerge: ^4.2.2 glob: ^7.1.3 graceful-fs: ^4.2.9 - jest-circus: ^29.5.0 - jest-environment-node: ^29.5.0 + jest-circus: ^29.6.2 + jest-environment-node: ^29.6.2 jest-get-type: ^29.4.3 jest-regex-util: ^29.4.3 - jest-resolve: ^29.5.0 - jest-runner: ^29.5.0 - jest-util: ^29.5.0 - jest-validate: ^29.5.0 + jest-resolve: ^29.6.2 + jest-runner: ^29.6.2 + jest-util: ^29.6.2 + jest-validate: ^29.6.2 micromatch: ^4.0.4 parse-json: ^5.2.0 - pretty-format: ^29.5.0 + pretty-format: ^29.6.2 slash: ^3.0.0 strip-json-comments: ^3.1.1 peerDependencies: @@ -4973,19 +5367,19 @@ __metadata: optional: true ts-node: optional: true - checksum: c37c4dab964c54ab293d4e302d40b09687037ac9d00b88348ec42366970747feeaf265e12e3750cd3660b40c518d4031335eda11ac10b70b10e60797ebbd4b9c + checksum: 3bd104a3ac2dd9d34986238142437606354169766dcf88359a7a12ac106d0dc17dcc6b627e4f20db97a58bac5b0502b5436c9cc4722b3629b2a114bba6da9128 languageName: node linkType: hard -"jest-diff@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-diff@npm:29.5.0" +"jest-diff@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-diff@npm:29.6.2" dependencies: chalk: ^4.0.0 diff-sequences: ^29.4.3 jest-get-type: ^29.4.3 - pretty-format: ^29.5.0 - checksum: dfd0f4a299b5d127779c76b40106c37854c89c3e0785098c717d52822d6620d227f6234c3a9291df204d619e799e3654159213bf93220f79c8e92a55475a3d39 + pretty-format: ^29.6.2 + checksum: 0effd66a0c23f8c139ebf7ca99ed30b479b86fff66f19ad4869f130aaf7ae6a24ca1533f697b7e4930cbe2ddffc85387723fcca673501c653fb77a38f538e959 languageName: node linkType: hard @@ -4998,30 +5392,30 @@ __metadata: languageName: node linkType: hard -"jest-each@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-each@npm:29.5.0" +"jest-each@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-each@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 chalk: ^4.0.0 jest-get-type: ^29.4.3 - jest-util: ^29.5.0 - pretty-format: ^29.5.0 - checksum: b8b297534d25834c5d4e31e4c687359787b1e402519e42664eb704cc3a12a7a91a017565a75acb02e8cf9afd3f4eef3350bd785276bec0900184641b765ff7a5 + jest-util: ^29.6.2 + pretty-format: ^29.6.2 + checksum: b64194f4ca27afc6070a42b7ecccbc68be0ded19a849f8cd8f91a2abb23fadae2d38d47559a315f4d1f576927761f3ea437a75ab6cf19206332abb8527d7c165 languageName: node linkType: hard -"jest-environment-node@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-environment-node@npm:29.5.0" +"jest-environment-node@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-environment-node@npm:29.6.2" dependencies: - "@jest/environment": ^29.5.0 - "@jest/fake-timers": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/environment": ^29.6.2 + "@jest/fake-timers": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" - jest-mock: ^29.5.0 - jest-util: ^29.5.0 - checksum: 57981911cc20a4219b0da9e22b2e3c9f31b505e43f78e61c899e3227ded455ce1a3a9483842c69cfa4532f02cfb536ae0995bf245f9211608edacfc1e478d411 + jest-mock: ^29.6.2 + jest-util: ^29.6.2 + checksum: 0b754ac2d3bdb7ce5d6fc28595b9d1c64176f20506b6f773b18b0280ab0b396ed7d927c8519779d3c560fa2b13236ee7077092ccb19a13bea23d40dd30f06450 languageName: node linkType: hard @@ -5032,11 +5426,11 @@ __metadata: languageName: node linkType: hard -"jest-haste-map@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-haste-map@npm:29.5.0" +"jest-haste-map@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-haste-map@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@types/graceful-fs": ^4.1.3 "@types/node": "*" anymatch: ^3.0.3 @@ -5044,64 +5438,64 @@ __metadata: fsevents: ^2.3.2 graceful-fs: ^4.2.9 jest-regex-util: ^29.4.3 - jest-util: ^29.5.0 - jest-worker: ^29.5.0 + jest-util: ^29.6.2 + jest-worker: ^29.6.2 micromatch: ^4.0.4 walker: ^1.0.8 dependenciesMeta: fsevents: optional: true - checksum: 3828ff7783f168e34be2c63887f82a01634261f605dcae062d83f979a61c37739e21b9607ecb962256aea3fbe5a530a1acee062d0026fcb47c607c12796cf3b7 + checksum: 726233972030eb2e5bce6c9468e497310436b455c88b40e744bd053e20a6f3ff19aec340edcbd89537c629ed5cf8916506bc895d690cc39a0862c74dcd95b7b8 languageName: node linkType: hard -"jest-leak-detector@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-leak-detector@npm:29.5.0" +"jest-leak-detector@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-leak-detector@npm:29.6.2" dependencies: jest-get-type: ^29.4.3 - pretty-format: ^29.5.0 - checksum: 0fb845da7ac9cdfc9b3b2e35f6f623a41c547d7dc0103ceb0349013459d00de5870b5689a625e7e37f9644934b40e8f1dcdd5422d14d57470600350364676313 + pretty-format: ^29.6.2 + checksum: e00152acdba8aa8f9334775b77375947508051c34646fbeb702275da2b6ac6145f8cad6d5893112e76484d00fa8c0b4fd71b78ab0b4ef34950f5b6a84f37ae67 languageName: node linkType: hard -"jest-matcher-utils@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-matcher-utils@npm:29.5.0" +"jest-matcher-utils@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-matcher-utils@npm:29.6.2" dependencies: chalk: ^4.0.0 - jest-diff: ^29.5.0 + jest-diff: ^29.6.2 jest-get-type: ^29.4.3 - pretty-format: ^29.5.0 - checksum: 1d3e8c746e484a58ce194e3aad152eff21fd0896e8b8bf3d4ab1a4e2cbfed95fb143646f4ad9fdf6e42212b9e8fc033268b58e011b044a9929df45485deb5ac9 + pretty-format: ^29.6.2 + checksum: 3e1b65dd30d05f75fe56dc45fbe4135aec2ff96a3d1e21afbf6a66f3a45a7e29cd0fd37cf80b9564e0381d6205833f77ccaf766c6f7e1aad6b7924d117be504e languageName: node linkType: hard -"jest-message-util@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-message-util@npm:29.5.0" +"jest-message-util@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-message-util@npm:29.6.2" dependencies: "@babel/code-frame": ^7.12.13 - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@types/stack-utils": ^2.0.0 chalk: ^4.0.0 graceful-fs: ^4.2.9 micromatch: ^4.0.4 - pretty-format: ^29.5.0 + pretty-format: ^29.6.2 slash: ^3.0.0 stack-utils: ^2.0.3 - checksum: daddece6bbf846eb6a2ab9be9f2446e54085bef4e5cecd13d2a538fa9c01cb89d38e564c6b74fd8e12d37ed9eface8a362240ae9f21d68b214590631e7a0d8bf + checksum: e8e3c8d2301e2ca4038ed6df8cbba7fedc6949d1ede4c0e3f1f44f53afb56d77eb35983fa460140d0eadeab99a5f3ae04b703fe77cd7b316b40b361228b5aa1a languageName: node linkType: hard -"jest-mock@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-mock@npm:29.5.0" +"jest-mock@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-mock@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@types/node": "*" - jest-util: ^29.5.0 - checksum: 2a9cf07509948fa8608898c445f04fe4dd6e2049ff431e5531eee028c808d3ba3c67f226ac87b0cf383feaa1055776900d197c895e89783016886ac17a4ff10c + jest-util: ^29.6.2 + checksum: 0bacb5d58441462c0e531ec4d2f7377eecbe21f664d8a460e72f94ba61d22635028931678e7a0f1c3e3f5894973db8e409432f7db4c01283456c8fdbd85f5b3b languageName: node linkType: hard @@ -5124,187 +5518,184 @@ __metadata: languageName: node linkType: hard -"jest-resolve-dependencies@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-resolve-dependencies@npm:29.5.0" +"jest-resolve-dependencies@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-resolve-dependencies@npm:29.6.2" dependencies: jest-regex-util: ^29.4.3 - jest-snapshot: ^29.5.0 - checksum: 479d2e5365d58fe23f2b87001e2e0adcbffe0147700e85abdec8f14b9703b0a55758c1929a9989e3f5d5e954fb88870ea4bfa04783523b664562fcf5f10b0edf + jest-snapshot: ^29.6.2 + checksum: d40ee11af2c9d2ef0dbbcf9a5b7dda37c2b86cf4e5de1705795919fd8927907569115c502116ab56de0dca576d5faa31ec9b636240333b6830a568a63004da17 languageName: node linkType: hard -"jest-resolve@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-resolve@npm:29.5.0" +"jest-resolve@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-resolve@npm:29.6.2" dependencies: chalk: ^4.0.0 graceful-fs: ^4.2.9 - jest-haste-map: ^29.5.0 + jest-haste-map: ^29.6.2 jest-pnp-resolver: ^1.2.2 - jest-util: ^29.5.0 - jest-validate: ^29.5.0 + jest-util: ^29.6.2 + jest-validate: ^29.6.2 resolve: ^1.20.0 resolve.exports: ^2.0.0 slash: ^3.0.0 - checksum: 9a125f3cf323ceef512089339d35f3ee37f79fe16a831fb6a26773ea6a229b9e490d108fec7af334142e91845b5996de8e7cdd85a4d8d617078737d804e29c8f + checksum: 01721957e61821a576b2ded043eeab8b392166e0e6d8d680f75657737e2ea7481ff29c2716b866ccd12e743f3a8da465504b1028e78b6a3c68b9561303de7ec8 languageName: node linkType: hard -"jest-runner@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-runner@npm:29.5.0" +"jest-runner@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-runner@npm:29.6.2" dependencies: - "@jest/console": ^29.5.0 - "@jest/environment": ^29.5.0 - "@jest/test-result": ^29.5.0 - "@jest/transform": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/console": ^29.6.2 + "@jest/environment": ^29.6.2 + "@jest/test-result": ^29.6.2 + "@jest/transform": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" chalk: ^4.0.0 emittery: ^0.13.1 graceful-fs: ^4.2.9 jest-docblock: ^29.4.3 - jest-environment-node: ^29.5.0 - jest-haste-map: ^29.5.0 - jest-leak-detector: ^29.5.0 - jest-message-util: ^29.5.0 - jest-resolve: ^29.5.0 - jest-runtime: ^29.5.0 - jest-util: ^29.5.0 - jest-watcher: ^29.5.0 - jest-worker: ^29.5.0 + jest-environment-node: ^29.6.2 + jest-haste-map: ^29.6.2 + jest-leak-detector: ^29.6.2 + jest-message-util: ^29.6.2 + jest-resolve: ^29.6.2 + jest-runtime: ^29.6.2 + jest-util: ^29.6.2 + jest-watcher: ^29.6.2 + jest-worker: ^29.6.2 p-limit: ^3.1.0 source-map-support: 0.5.13 - checksum: 437dea69c5dddca22032259787bac74790d5a171c9d804711415f31e5d1abfb64fa52f54a9015bb17a12b858fd0cf3f75ef6f3c9e94255a8596e179f707229c4 + checksum: 46bd506a08ddf79628a509aed4105ab74c0b03727a3e24c90bbc2915531860b3da99f7ace2fd9603194440553cffac9cfb1a3b7d0ce03d5fc9c5f2d5ffbb3d3f languageName: node linkType: hard -"jest-runtime@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-runtime@npm:29.5.0" - dependencies: - "@jest/environment": ^29.5.0 - "@jest/fake-timers": ^29.5.0 - "@jest/globals": ^29.5.0 - "@jest/source-map": ^29.4.3 - "@jest/test-result": ^29.5.0 - "@jest/transform": ^29.5.0 - "@jest/types": ^29.5.0 +"jest-runtime@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-runtime@npm:29.6.2" + dependencies: + "@jest/environment": ^29.6.2 + "@jest/fake-timers": ^29.6.2 + "@jest/globals": ^29.6.2 + "@jest/source-map": ^29.6.0 + "@jest/test-result": ^29.6.2 + "@jest/transform": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" chalk: ^4.0.0 cjs-module-lexer: ^1.0.0 collect-v8-coverage: ^1.0.0 glob: ^7.1.3 graceful-fs: ^4.2.9 - jest-haste-map: ^29.5.0 - jest-message-util: ^29.5.0 - jest-mock: ^29.5.0 + jest-haste-map: ^29.6.2 + jest-message-util: ^29.6.2 + jest-mock: ^29.6.2 jest-regex-util: ^29.4.3 - jest-resolve: ^29.5.0 - jest-snapshot: ^29.5.0 - jest-util: ^29.5.0 + jest-resolve: ^29.6.2 + jest-snapshot: ^29.6.2 + jest-util: ^29.6.2 slash: ^3.0.0 strip-bom: ^4.0.0 - checksum: 7af27bd9d54cf1c5735404cf8d76c6509d5610b1ec0106a21baa815c1aff15d774ce534ac2834bc440dccfe6348bae1885fd9a806f23a94ddafdc0f5bae4b09d + checksum: 8e7e4486b23b01a9c407313681bed0def39680c2ae21cf01347f111983252ec3a024c56493c5411fed53633f02863eed0816099110cbe04b3889aa5babf1042d languageName: node linkType: hard -"jest-snapshot@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-snapshot@npm:29.5.0" +"jest-snapshot@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-snapshot@npm:29.6.2" dependencies: "@babel/core": ^7.11.6 "@babel/generator": ^7.7.2 "@babel/plugin-syntax-jsx": ^7.7.2 "@babel/plugin-syntax-typescript": ^7.7.2 - "@babel/traverse": ^7.7.2 "@babel/types": ^7.3.3 - "@jest/expect-utils": ^29.5.0 - "@jest/transform": ^29.5.0 - "@jest/types": ^29.5.0 - "@types/babel__traverse": ^7.0.6 - "@types/prettier": ^2.1.5 + "@jest/expect-utils": ^29.6.2 + "@jest/transform": ^29.6.2 + "@jest/types": ^29.6.1 babel-preset-current-node-syntax: ^1.0.0 chalk: ^4.0.0 - expect: ^29.5.0 + expect: ^29.6.2 graceful-fs: ^4.2.9 - jest-diff: ^29.5.0 + jest-diff: ^29.6.2 jest-get-type: ^29.4.3 - jest-matcher-utils: ^29.5.0 - jest-message-util: ^29.5.0 - jest-util: ^29.5.0 + jest-matcher-utils: ^29.6.2 + jest-message-util: ^29.6.2 + jest-util: ^29.6.2 natural-compare: ^1.4.0 - pretty-format: ^29.5.0 - semver: ^7.3.5 - checksum: fe5df54122ed10eed625de6416a45bc4958d5062b018f05b152bf9785ab7f355dcd55e40cf5da63895bf8278f8d7b2bb4059b2cfbfdee18f509d455d37d8aa2b + pretty-format: ^29.6.2 + semver: ^7.5.3 + checksum: c1c70a9dbce7fca62ed73ac38234b4ee643e8b667acf71b4417ab67776c1188bb08b8ad450e56a2889ad182903ffd416386fa8082a477724ccf8d8c29a4c6906 languageName: node linkType: hard -"jest-util@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-util@npm:29.5.0" +"jest-util@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-util@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 "@types/node": "*" chalk: ^4.0.0 ci-info: ^3.2.0 graceful-fs: ^4.2.9 picomatch: ^2.2.3 - checksum: fd9212950d34d2ecad8c990dda0d8ea59a8a554b0c188b53ea5d6c4a0829a64f2e1d49e6e85e812014933d17426d7136da4785f9cf76fff1799de51b88bc85d3 + checksum: 8aedc0c80083d0cabd6c6c4f04dea1cbcac609fd7bc3b1fc05a3999291bd6e63dd52b0c806f9378d5cae28eff5a6191709a4987861001293f8d03e53984adca4 languageName: node linkType: hard -"jest-validate@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-validate@npm:29.5.0" +"jest-validate@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-validate@npm:29.6.2" dependencies: - "@jest/types": ^29.5.0 + "@jest/types": ^29.6.1 camelcase: ^6.2.0 chalk: ^4.0.0 jest-get-type: ^29.4.3 leven: ^3.1.0 - pretty-format: ^29.5.0 - checksum: 43ca5df7cb75572a254ac3e92fbbe7be6b6a1be898cc1e887a45d55ea003f7a112717d814a674d37f9f18f52d8de40873c8f084f17664ae562736c78dd44c6a1 + pretty-format: ^29.6.2 + checksum: 32648d002189c0ad8a958eace7c6b7d05ea1dc440a1b91e0f22dc1aef489899446ec80b2d527fd13713862d89dfb4606e24a3bf8a10c4ddac3c911e93b7f0374 languageName: node linkType: hard -"jest-watcher@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-watcher@npm:29.5.0" +"jest-watcher@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-watcher@npm:29.6.2" dependencies: - "@jest/test-result": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/test-result": ^29.6.2 + "@jest/types": ^29.6.1 "@types/node": "*" ansi-escapes: ^4.2.1 chalk: ^4.0.0 emittery: ^0.13.1 - jest-util: ^29.5.0 + jest-util: ^29.6.2 string-length: ^4.0.1 - checksum: 62303ac7bdc7e61a8b4239a239d018f7527739da2b2be6a81a7be25b74ca769f1c43ee8558ce8e72bb857245c46d6e03af331227ffb00a57280abb2a928aa776 + checksum: 14624190fc8b5fbae466a2ec81458a88c15716d99f042bb4674d53e9623d305cb2905bc1dffeda05fd1a10a05c2a83efe5ac41942477e2b15eaebb08d0aaab32 languageName: node linkType: hard -"jest-worker@npm:^29.5.0": - version: 29.5.0 - resolution: "jest-worker@npm:29.5.0" +"jest-worker@npm:^29.6.2": + version: 29.6.2 + resolution: "jest-worker@npm:29.6.2" dependencies: "@types/node": "*" - jest-util: ^29.5.0 + jest-util: ^29.6.2 merge-stream: ^2.0.0 supports-color: ^8.0.0 - checksum: 1151a1ae3602b1ea7c42a8f1efe2b5a7bf927039deaa0827bf978880169899b705744e288f80a63603fb3fc2985e0071234986af7dc2c21c7a64333d8777c7c9 + checksum: 11035564534bf181ead80b25be138c2d42372bd5626151a3e705200d47a74fd9da3ca79f8a7b15806cdc325ad73c3d21d23acceeed99d50941589ff02915ed38 languageName: node linkType: hard "jest@npm:^29.5.0": - version: 29.5.0 - resolution: "jest@npm:29.5.0" + version: 29.6.2 + resolution: "jest@npm:29.6.2" dependencies: - "@jest/core": ^29.5.0 - "@jest/types": ^29.5.0 + "@jest/core": ^29.6.2 + "@jest/types": ^29.6.1 import-local: ^3.0.2 - jest-cli: ^29.5.0 + jest-cli: ^29.6.2 peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 peerDependenciesMeta: @@ -5312,14 +5703,7 @@ __metadata: optional: true bin: jest: bin/jest.js - checksum: a8ff2eb0f421623412236e23cbe67c638127fffde466cba9606bc0c0553b4c1e5cb116d7e0ef990b5d1712851652c8ee461373b578df50857fe635b94ff455d5 - languageName: node - linkType: hard - -"js-sdsl@npm:^4.1.4": - version: 4.4.0 - resolution: "js-sdsl@npm:4.4.0" - checksum: 7bb08a2d746ab7ff742720339aa006c631afe05e77d11eda988c1c35fae8e03e492e4e347e883e786e3ce6170685d4780c125619111f0730c11fdb41b04059c7 + checksum: dd63facd4e6aefc35d2c42acd7e4c9fb0d8fe4705df4b3ccedd953605424d7aa89c88af8cf4c9951752709cac081d29c35b264e1794643d5688ea724ccc9a485 languageName: node linkType: hard @@ -5446,11 +5830,11 @@ __metadata: linkType: hard "keyv@npm:^4.0.0": - version: 4.5.2 - resolution: "keyv@npm:4.5.2" + version: 4.5.3 + resolution: "keyv@npm:4.5.3" dependencies: json-buffer: 3.0.1 - checksum: 13ad58303acd2261c0d4831b4658451603fd159e61daea2121fcb15feb623e75ee328cded0572da9ca76b7b3ceaf8e614f1806c6b3af5db73c9c35a345259651 + checksum: 3ffb4d5b72b6b4b4af443bbb75ca2526b23c750fccb5ac4c267c6116888b4b65681015c2833cb20d26cf3e6e32dac6b988c77f7f022e1a571b7d90f1442257da languageName: node linkType: hard @@ -5510,7 +5894,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.20, lodash@npm:^4.17.21": +"lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7 @@ -5559,6 +5943,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^9.1.1 || ^10.0.0": + version: 10.0.0 + resolution: "lru-cache@npm:10.0.0" + checksum: 18f101675fe283bc09cda0ef1e3cc83781aeb8373b439f086f758d1d91b28730950db785999cd060d3c825a8571c03073e8c14512b6655af2188d623031baf50 + languageName: node + linkType: hard + "lunr@npm:^2.3.9": version: 2.3.9 resolution: "lunr@npm:2.3.9" @@ -5575,36 +5966,35 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^3.0.0": - version: 3.1.0 - resolution: "make-dir@npm:3.1.0" +"make-dir@npm:^4.0.0": + version: 4.0.0 + resolution: "make-dir@npm:4.0.0" dependencies: - semver: ^6.0.0 - checksum: 484200020ab5a1fdf12f393fe5f385fc8e4378824c940fba1729dcd198ae4ff24867bc7a5646331e50cead8abff5d9270c456314386e629acec6dff4b8016b78 + semver: ^7.5.3 + checksum: bf0731a2dd3aab4db6f3de1585cea0b746bb73eb5a02e3d8d72757e376e64e6ada190b1eddcde5b2f24a81b688a9897efd5018737d05e02e2a671dda9cff8a8a languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3": - version: 10.2.1 - resolution: "make-fetch-happen@npm:10.2.1" +"make-fetch-happen@npm:^11.0.3": + version: 11.1.1 + resolution: "make-fetch-happen@npm:11.1.1" dependencies: agentkeepalive: ^4.2.1 - cacache: ^16.1.0 - http-cache-semantics: ^4.1.0 + cacache: ^17.0.0 + http-cache-semantics: ^4.1.1 http-proxy-agent: ^5.0.0 https-proxy-agent: ^5.0.0 is-lambda: ^1.0.1 lru-cache: ^7.7.1 - minipass: ^3.1.6 - minipass-collect: ^1.0.2 - minipass-fetch: ^2.0.3 + minipass: ^5.0.0 + minipass-fetch: ^3.0.0 minipass-flush: ^1.0.5 minipass-pipeline: ^1.2.4 negotiator: ^0.6.3 promise-retry: ^2.0.1 socks-proxy-agent: ^7.0.0 - ssri: ^9.0.0 - checksum: 2332eb9a8ec96f1ffeeea56ccefabcb4193693597b132cd110734d50f2928842e22b84cfa1508e921b8385cdfd06dda9ad68645fed62b50fff629a580f5fb72c + ssri: ^10.0.0 + checksum: 7268bf274a0f6dcf0343829489a4506603ff34bd0649c12058753900b0eb29191dce5dba12680719a5d0a983d3e57810f594a12f3c18494e93a1fbc6348a4540 languageName: node linkType: hard @@ -5626,6 +6016,26 @@ __metadata: languageName: node linkType: hard +"md5.js@npm:^1.3.4": + version: 1.3.5 + resolution: "md5.js@npm:1.3.5" + dependencies: + hash-base: ^3.0.0 + inherits: ^2.0.1 + safe-buffer: ^5.1.2 + checksum: 098494d885684bcc4f92294b18ba61b7bd353c23147fbc4688c75b45cb8590f5a95fd4584d742415dcc52487f7a1ef6ea611cfa1543b0dc4492fe026357f3f0c + languageName: node + linkType: hard + +"merge-options@npm:^3.0.4": + version: 3.0.4 + resolution: "merge-options@npm:3.0.4" + dependencies: + is-plain-obj: ^2.1.0 + checksum: d86ddb3dd6e85d558dbf25dc944f3527b6bacb944db3fdda6e84a3f59c4e4b85231095f58b835758b9a57708342dee0f8de0dffa352974a48221487fe9f4584f + languageName: node + linkType: hard + "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -5650,6 +6060,18 @@ __metadata: languageName: node linkType: hard +"miller-rabin@npm:^4.0.0": + version: 4.0.1 + resolution: "miller-rabin@npm:4.0.1" + dependencies: + bn.js: ^4.0.0 + brorand: ^1.0.1 + bin: + miller-rabin: bin/miller-rabin + checksum: 00cd1ab838ac49b03f236cc32a14d29d7d28637a53096bf5c6246a032a37749c9bd9ce7360cbf55b41b89b7d649824949ff12bc8eee29ac77c6b38eada619ece + languageName: node + linkType: hard + "mime-db@npm:^1.28.0": version: 1.52.0 resolution: "mime-db@npm:1.52.0" @@ -5719,6 +6141,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: ^2.0.1 + checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 + languageName: node + linkType: hard + "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -5735,18 +6166,18 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^2.0.3": - version: 2.1.2 - resolution: "minipass-fetch@npm:2.1.2" +"minipass-fetch@npm:^3.0.0": + version: 3.0.3 + resolution: "minipass-fetch@npm:3.0.3" dependencies: encoding: ^0.1.13 - minipass: ^3.1.6 + minipass: ^5.0.0 minipass-sized: ^1.0.3 minizlib: ^2.1.2 dependenciesMeta: encoding: optional: true - checksum: 3f216be79164e915fc91210cea1850e488793c740534985da017a4cbc7a5ff50506956d0f73bb0cb60e4fe91be08b6b61ef35101706d3ef5da2c8709b5f08f91 + checksum: af5ab2552a16fcf505d35fd7ffb84b57f4a0eeb269e6e1d9a2a75824dda48b36e527083250b7cca4a4def21d9544e2ade441e4730e233c0bc2133f6abda31e18 languageName: node linkType: hard @@ -5777,7 +6208,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -5793,6 +6224,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0": + version: 7.0.2 + resolution: "minipass@npm:7.0.2" + checksum: 46776de732eb7cef2c7404a15fb28c41f5c54a22be50d47b03c605bf21f5c18d61a173c0a20b49a97e7a65f78d887245066410642551e45fffe04e9ac9e325bc + languageName: node + linkType: hard + "minizlib@npm:^2.1.1, minizlib@npm:^2.1.2": version: 2.1.2 resolution: "minizlib@npm:2.1.2" @@ -5803,7 +6241,7 @@ __metadata: languageName: node linkType: hard -"mkdirp@npm:^1.0.3, mkdirp@npm:^1.0.4": +"mkdirp@npm:^1.0.3": version: 1.0.4 resolution: "mkdirp@npm:1.0.4" bin: @@ -5882,9 +6320,9 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7": - version: 2.6.11 - resolution: "node-fetch@npm:2.6.11" +"node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.12": + version: 2.6.12 + resolution: "node-fetch@npm:2.6.12" dependencies: whatwg-url: ^5.0.0 peerDependencies: @@ -5892,7 +6330,7 @@ __metadata: peerDependenciesMeta: encoding: optional: true - checksum: 249d0666a9497553384d46b5ab296ba223521ac88fed4d8a17d6ee6c2efb0fc890f3e8091cafe7f9fba8151a5b8d925db2671543b3409a56c3cd522b468b47b3 + checksum: 3bc1655203d47ee8e313c0d96664b9673a3d4dd8002740318e9d27d14ef306693a4b2ef8d6525775056fd912a19e23f3ac0d7111ad8925877b7567b29a625592 languageName: node linkType: hard @@ -5908,13 +6346,14 @@ __metadata: linkType: hard "node-gyp@npm:latest": - version: 9.3.1 - resolution: "node-gyp@npm:9.3.1" + version: 9.4.0 + resolution: "node-gyp@npm:9.4.0" dependencies: env-paths: ^2.2.0 + exponential-backoff: ^3.1.1 glob: ^7.1.4 graceful-fs: ^4.2.6 - make-fetch-happen: ^10.0.3 + make-fetch-happen: ^11.0.3 nopt: ^6.0.0 npmlog: ^6.0.0 rimraf: ^3.0.2 @@ -5923,7 +6362,7 @@ __metadata: which: ^2.0.2 bin: node-gyp: bin/node-gyp.js - checksum: b860e9976fa645ca0789c69e25387401b4396b93c8375489b5151a6c55cf2640a3b6183c212b38625ef7c508994930b72198338e3d09b9d7ade5acc4aaf51ea7 + checksum: 78b404e2e0639d64e145845f7f5a3cb20c0520cdaf6dda2f6e025e9b644077202ea7de1232396ba5bde3fee84cdc79604feebe6ba3ec84d464c85d407bb5da99 languageName: node linkType: hard @@ -5934,10 +6373,10 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.8": - version: 2.0.10 - resolution: "node-releases@npm:2.0.10" - checksum: d784ecde25696a15d449c4433077f5cce620ed30a1656c4abf31282bfc691a70d9618bae6868d247a67914d1be5cc4fde22f65a05f4398cdfb92e0fc83cadfbc +"node-releases@npm:^2.0.13": + version: 2.0.13 + resolution: "node-releases@npm:2.0.13" + checksum: 17ec8f315dba62710cae71a8dad3cd0288ba943d2ece43504b3b1aa8625bf138637798ab470b1d9035b0545996f63000a8a926e0f6d35d0996424f8b6d36dda3 languageName: node linkType: hard @@ -6038,6 +6477,29 @@ __metadata: languageName: node linkType: hard +"object.fromentries@npm:^2.0.6": + version: 2.0.6 + resolution: "object.fromentries@npm:2.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 453c6d694180c0c30df451b60eaf27a5b9bca3fb43c37908fd2b78af895803dc631242bcf05582173afa40d8d0e9c96e16e8874b39471aa53f3ac1f98a085d85 + languageName: node + linkType: hard + +"object.groupby@npm:^1.0.0": + version: 1.0.0 + resolution: "object.groupby@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + es-abstract: ^1.21.2 + get-intrinsic: ^1.2.1 + checksum: 64b00b287d57580111c958e7ff375c9b61811fa356f2cf0d35372d43cab61965701f00fac66c19fd8f49c4dfa28744bee6822379c69a73648ad03e09fcdeae70 + languageName: node + linkType: hard + "object.values@npm:^1.1.6": version: 1.1.6 resolution: "object.values@npm:1.1.6" @@ -6067,17 +6529,17 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.1": - version: 0.9.1 - resolution: "optionator@npm:0.9.1" +"optionator@npm:^0.9.3": + version: 0.9.3 + resolution: "optionator@npm:0.9.3" dependencies: + "@aashutoshrathi/word-wrap": ^1.2.3 deep-is: ^0.1.3 fast-levenshtein: ^2.0.6 levn: ^0.4.1 prelude-ls: ^1.2.1 type-check: ^0.4.0 - word-wrap: ^1.2.3 - checksum: dbc6fa065604b24ea57d734261914e697bd73b69eff7f18e967e8912aa2a40a19a9f599a507fa805be6c13c24c4eae8c71306c239d517d42d4c041c942f508a0 + checksum: 09281999441f2fe9c33a5eeab76700795365a061563d66b098923eb719251a42bdbe432790d35064d0816ead9296dbeb1ad51a733edf4167c96bd5d0882e428a languageName: node linkType: hard @@ -6165,6 +6627,19 @@ __metadata: languageName: node linkType: hard +"parse-asn1@npm:^5.0.0, parse-asn1@npm:^5.1.5": + version: 5.1.6 + resolution: "parse-asn1@npm:5.1.6" + dependencies: + asn1.js: ^5.2.0 + browserify-aes: ^1.0.0 + evp_bytestokey: ^1.0.0 + pbkdf2: ^3.0.3 + safe-buffer: ^5.1.1 + checksum: 9243311d1f88089bc9f2158972aa38d1abd5452f7b7cabf84954ed766048fe574d434d82c6f5a39b988683e96fb84cd933071dda38927e03469dc8c8d14463c7 + languageName: node + linkType: hard + "parse-json@npm:^5.2.0": version: 5.2.0 resolution: "parse-json@npm:5.2.0" @@ -6212,6 +6687,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^1.10.1": + version: 1.10.1 + resolution: "path-scurry@npm:1.10.1" + dependencies: + lru-cache: ^9.1.1 || ^10.0.0 + minipass: ^5.0.0 || ^6.0.2 || ^7.0.0 + checksum: e2557cff3a8fb8bc07afdd6ab163a92587884f9969b05bbbaf6fe7379348bfb09af9ed292af12ed32398b15fb443e81692047b786d1eeb6d898a51eb17ed7d90 + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -6219,6 +6704,19 @@ __metadata: languageName: node linkType: hard +"pbkdf2@npm:^3.0.3": + version: 3.1.2 + resolution: "pbkdf2@npm:3.1.2" + dependencies: + create-hash: ^1.1.2 + create-hmac: ^1.1.4 + ripemd160: ^2.0.1 + safe-buffer: ^5.0.1 + sha.js: ^2.4.8 + checksum: 2c950a100b1da72123449208e231afc188d980177d021d7121e96a2de7f2abbc96ead2b87d03d8fe5c318face097f203270d7e27908af9f471c165a4e8e69c92 + languageName: node + linkType: hard + "peek-readable@npm:^5.0.0": version: 5.0.0 resolution: "peek-readable@npm:5.0.0" @@ -6248,9 +6746,9 @@ __metadata: linkType: hard "pirates@npm:^4.0.4": - version: 4.0.5 - resolution: "pirates@npm:4.0.5" - checksum: c9994e61b85260bec6c4fc0307016340d9b0c4f4b6550a957afaaff0c9b1ad58fbbea5cfcf083860a25cb27a375442e2b0edf52e2e1e40e69934e08dcc52d227 + version: 4.0.6 + resolution: "pirates@npm:4.0.6" + checksum: 46a65fefaf19c6f57460388a5af9ab81e3d7fd0e7bc44ca59d753cb5c4d0df97c6c6e583674869762101836d68675f027d60f841c105d72734df9dfca97cbcc6 languageName: node linkType: hard @@ -6297,21 +6795,14 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.5.0": - version: 29.5.0 - resolution: "pretty-format@npm:29.5.0" +"pretty-format@npm:^29.0.0, pretty-format@npm:^29.6.2": + version: 29.6.2 + resolution: "pretty-format@npm:29.6.2" dependencies: - "@jest/schemas": ^29.4.3 + "@jest/schemas": ^29.6.0 ansi-styles: ^5.0.0 react-is: ^18.0.0 - checksum: 4065356b558e6db25b4d41a01efb386935a6c06a0c9c104ef5ce59f2f476b8210edb8b3949b386e60ada0a6dc5ebcb2e6ccddc8c64dfd1a9943c3c3a9e7eaf89 - languageName: node - linkType: hard - -"promise-inflight@npm:^1.0.1": - version: 1.0.1 - resolution: "promise-inflight@npm:1.0.1" - checksum: 22749483091d2c594261517f4f80e05226d4d5ecc1fc917e1886929da56e22b5718b7f2a75f3807e7a7d471bc3be2907fe92e6e8f373ddf5c64bae35b5af3981 + checksum: a0f972a44f959023c0df9cdfe9eed7540264d7f7ddf74667db8a5294444d5aa153fd47d20327df10ae86964e2ceec10e46ea06b1a5c9c12e02348b78c952c9fc languageName: node linkType: hard @@ -6342,6 +6833,20 @@ __metadata: languageName: node linkType: hard +"public-encrypt@npm:^4.0.0": + version: 4.0.3 + resolution: "public-encrypt@npm:4.0.3" + dependencies: + bn.js: ^4.1.0 + browserify-rsa: ^4.0.0 + create-hash: ^1.1.0 + parse-asn1: ^5.0.0 + randombytes: ^2.0.1 + safe-buffer: ^5.1.2 + checksum: 215d446e43cef021a20b67c1df455e5eea134af0b1f9b8a35f9e850abf32991b0c307327bc5b9bc07162c288d5cdb3d4a783ea6c6640979ed7b5017e3e0c9935 + languageName: node + linkType: hard + "pump@npm:^3.0.0": version: 3.0.0 resolution: "pump@npm:3.0.0" @@ -6387,7 +6892,7 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:^2.1.0": +"randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" dependencies: @@ -6396,6 +6901,16 @@ __metadata: languageName: node linkType: hard +"randomfill@npm:^1.0.3": + version: 1.0.4 + resolution: "randomfill@npm:1.0.4" + dependencies: + randombytes: ^2.0.5 + safe-buffer: ^5.1.0 + checksum: 33734bb578a868d29ee1b8555e21a36711db084065d94e019a6d03caa67debef8d6a1bfd06a2b597e32901ddc761ab483a85393f0d9a75838f1912461d4dbfc7 + languageName: node + linkType: hard + "react-is@npm:^18.0.0": version: 18.2.0 resolution: "react-is@npm:18.2.0" @@ -6439,7 +6954,7 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3": +"regexp.prototype.flags@npm:^1.5.0": version: 1.5.0 resolution: "regexp.prototype.flags@npm:1.5.0" dependencies: @@ -6494,29 +7009,29 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.20.0, resolve@npm:^1.22.1": - version: 1.22.3 - resolution: "resolve@npm:1.22.3" +"resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.22.3, resolve@npm:^1.22.4": + version: 1.22.4 + resolution: "resolve@npm:1.22.4" dependencies: - is-core-module: ^2.12.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: fb834b81348428cb545ff1b828a72ea28feb5a97c026a1cf40aa1008352c72811ff4d4e71f2035273dc536dcfcae20c13604ba6283c612d70fa0b6e44519c374 + checksum: 23f25174c2736ce24c6d918910e0d1f89b6b38fefa07a995dff864acd7863d59a7f049e691f93b4b2ee29696303390d921552b6d1b841ed4a8101f517e1d0124 languageName: node linkType: hard -"resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": - version: 1.22.3 - resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d" +"resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.22.3#~builtin, resolve@patch:resolve@^1.22.4#~builtin": + version: 1.22.4 + resolution: "resolve@patch:resolve@npm%3A1.22.4#~builtin::version=1.22.4&hash=c3c19d" dependencies: - is-core-module: ^2.12.0 + is-core-module: ^2.13.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: ad59734723b596d0891321c951592ed9015a77ce84907f89c9d9307dd0c06e11a67906a3e628c4cae143d3e44898603478af0ddeb2bba3f229a9373efe342665 + checksum: c45f2545fdc4d21883861b032789e20aa67a2f2692f68da320cc84d5724cd02f2923766c5354b3210897e88f1a7b3d6d2c7c22faeead8eed7078e4c783a444bc languageName: node linkType: hard @@ -6554,6 +7069,16 @@ __metadata: languageName: node linkType: hard +"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": + version: 2.0.2 + resolution: "ripemd160@npm:2.0.2" + dependencies: + hash-base: ^3.0.0 + inherits: ^2.0.1 + checksum: 006accc40578ee2beae382757c4ce2908a826b27e2b079efdcd2959ee544ddf210b7b5d7d5e80467807604244e7388427330f5c6d4cd61e6edaddc5773ccc393 + languageName: node + linkType: hard + "rollup-plugin-polyfill-node@npm:^0.12.0": version: 0.12.0 resolution: "rollup-plugin-polyfill-node@npm:0.12.0" @@ -6566,8 +7091,8 @@ __metadata: linkType: hard "rollup@npm:^3.18.0": - version: 3.22.0 - resolution: "rollup@npm:3.22.0" + version: 3.27.2 + resolution: "rollup@npm:3.27.2" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -6575,7 +7100,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 6da2bfe1eb16714ccd4bf56ca92430309dc71b4492a3c38502f68f645433dcc789fb79f3761fc2269aa0cf20ece7821c4d7c95b860b7343c2ed52ed1c36c9a90 + checksum: 524477e73885bafd2df395c12db330f3893e1f8eca67e811fb1423a4f6318451987e978607c75f8115bd9ce7fa834460969b0c39b797d45da87fa42fef9bafa8 languageName: node linkType: hard @@ -6616,7 +7141,19 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-array-concat@npm:^1.0.0": + version: 1.0.0 + resolution: "safe-array-concat@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.0 + has-symbols: ^1.0.3 + isarray: ^2.0.5 + checksum: f43cb98fe3b566327d0c09284de2b15fb85ae964a89495c1b1a5d50c7c8ed484190f4e5e71aacc167e16231940079b326f2c0807aea633d47cc7322f40a6b57f + languageName: node + linkType: hard + +"safe-buffer@npm:5.2.1, safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -6634,7 +7171,7 @@ __metadata: languageName: node linkType: hard -"safer-buffer@npm:>= 2.1.2 < 3.0.0": +"safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" checksum: cab8f25ae6f1434abee8d80023d7e72b598cf1327164ddab31003c51215526801e40b66c5e65d658a0af1e9d6478cadcb4c745f4bd6751f97d8644786c0978b0 @@ -6655,32 +7192,32 @@ __metadata: languageName: node linkType: hard -"semver-truncate@npm:^2.0.0": - version: 2.0.0 - resolution: "semver-truncate@npm:2.0.0" +"semver-truncate@npm:^3.0.0": + version: 3.0.0 + resolution: "semver-truncate@npm:3.0.0" dependencies: - semver: ^6.0.0 - checksum: 713c2bd49add098c3fd6271091e7c8c13908ab3f052d58a19b68920da9f101d34eb6a0c60ef4bd5fa3c345f001e0df37bb831602082441bb35ba857cac42e0f4 + semver: ^7.3.5 + checksum: d8c23812218ff147f512ac4830e86860a377dba8a9733ae97d816102aca33236fa1c44c06544727153fffb93d15d0e45c49b2c40a7964aa3671769e9aed2f3f9 languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.3.0": - version: 6.3.0 - resolution: "semver@npm:6.3.0" +"semver@npm:^6.3.0, semver@npm:^6.3.1": + version: 6.3.1 + resolution: "semver@npm:6.3.1" bin: - semver: ./bin/semver.js - checksum: 1b26ecf6db9e8292dd90df4e781d91875c0dcc1b1909e70f5d12959a23c7eebb8f01ea581c00783bbee72ceeaad9505797c381756326073850dc36ed284b21b9 + semver: bin/semver.js + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 languageName: node linkType: hard -"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": - version: 7.5.1 - resolution: "semver@npm:7.5.1" +"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3": + version: 7.5.4 + resolution: "semver@npm:7.5.4" dependencies: lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: d16dbedad53c65b086f79524b9ef766bf38670b2395bdad5c957f824dcc566b624988013564f4812bcace3f9d405355c3635e2007396a39d1bffc71cfec4a2fc + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard @@ -6707,6 +7244,18 @@ __metadata: languageName: node linkType: hard +"sha.js@npm:^2.4.0, sha.js@npm:^2.4.8": + version: 2.4.11 + resolution: "sha.js@npm:2.4.11" + dependencies: + inherits: ^2.0.1 + safe-buffer: ^5.0.1 + bin: + sha.js: ./bin.js + checksum: ebd3f59d4b799000699097dadb831c8e3da3eb579144fd7eb7a19484cbcbb7aca3c68ba2bb362242eb09e33217de3b4ea56e4678184c334323eca24a58e3ad07 + languageName: node + linkType: hard + "shebang-command@npm:^1.2.0": version: 1.2.0 resolution: "shebang-command@npm:1.2.0" @@ -6740,14 +7289,14 @@ __metadata: linkType: hard "shiki@npm:^0.14.1": - version: 0.14.2 - resolution: "shiki@npm:0.14.2" + version: 0.14.3 + resolution: "shiki@npm:0.14.3" dependencies: ansi-sequence-parser: ^1.1.0 jsonc-parser: ^3.2.0 vscode-oniguruma: ^1.7.0 vscode-textmate: ^8.0.0 - checksum: f2a14302b1803617e3ff1b751a5c87b4af4ad15214dc00e9215402e42940a84a0b956cf55d628f25dbf1296b18e277b8529571cd9359b971ac599a0ab11303e7 + checksum: a4dd98e3b2a5dd8be207448f111ffb9ad2ed6c530f215714d8b61cbf91ec3edbabb09109b8ec58a26678aacd24e8161d5a9bc0c1fa1b4f64b27ceb180cbd0c89 languageName: node linkType: hard @@ -6769,6 +7318,13 @@ __metadata: languageName: node linkType: hard +"signal-exit@npm:^4.0.1": + version: 4.1.0 + resolution: "signal-exit@npm:4.1.0" + checksum: 64c757b498cb8629ffa5f75485340594d2f8189e9b08700e69199069c8e3070fb3e255f7ab873c05dc0b3cec412aea7402e10a5990cb6a050bd33ba062a6c549 + languageName: node + linkType: hard + "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -6798,9 +7354,9 @@ __metadata: linkType: hard "smob@npm:^1.0.0": - version: 1.0.0 - resolution: "smob@npm:1.0.0" - checksum: 6b6416f14b030f57ee05fc0d294fde5d22ce77b1baba024e6b58db0c9b0c662e3348b38b9e419ab8d1eac6c54854893cb5a9289e5160d37eb15a3e766e1a51f8 + version: 1.4.0 + resolution: "smob@npm:1.4.0" + checksum: f693b42698c90262dee4324eae635ea2aa16782161274b47417f87e353880487cdea8e6d9d07fb9b2a0e0df472ef0c5a1bfc07395edd8acfad7062797c1293ca languageName: node linkType: hard @@ -6884,12 +7440,12 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" +"ssri@npm:^10.0.0": + version: 10.0.4 + resolution: "ssri@npm:10.0.4" dependencies: - minipass: ^3.1.1 - checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb + minipass: ^5.0.0 + checksum: fb14da9f8a72b04eab163eb13a9dda11d5962cd2317f85457c4e0b575e9a6e0e3a6a87b5bf122c75cb36565830cd5f263fb457571bf6f1587eb5f95d095d6165 languageName: node linkType: hard @@ -6919,7 +7475,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -6930,6 +7486,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^5.0.1, string-width@npm:^5.1.2": + version: 5.1.2 + resolution: "string-width@npm:5.1.2" + dependencies: + eastasianwidth: ^0.2.0 + emoji-regex: ^9.2.2 + strip-ansi: ^7.0.1 + checksum: 7369deaa29f21dda9a438686154b62c2c5f661f8dda60449088f9f980196f7908fc39fdd1803e3e01541970287cf5deae336798337e9319a7055af89dafa7193 + languageName: node + linkType: hard + "string.prototype.trim@npm:^1.2.7": version: 1.2.7 resolution: "string.prototype.trim@npm:1.2.7" @@ -6972,7 +7539,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" dependencies: @@ -6981,6 +7548,15 @@ __metadata: languageName: node linkType: hard +"strip-ansi@npm:^7.0.1": + version: 7.1.0 + resolution: "strip-ansi@npm:7.1.0" + dependencies: + ansi-regex: ^6.0.1 + checksum: 859c73fcf27869c22a4e4d8c6acfe690064659e84bef9458aa6d13719d09ca88dcfd40cbf31fd0be63518ea1a643fe070b4827d353e09533a5b0b9fd4553d64d + languageName: node + linkType: hard + "strip-bom@npm:^3.0.0": version: 3.0.0 resolution: "strip-bom@npm:3.0.0" @@ -7016,7 +7592,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -7096,16 +7672,16 @@ __metadata: linkType: hard "terser@npm:^5.17.4": - version: 5.17.4 - resolution: "terser@npm:5.17.4" + version: 5.19.2 + resolution: "terser@npm:5.19.2" dependencies: - "@jridgewell/source-map": ^0.3.2 - acorn: ^8.5.0 + "@jridgewell/source-map": ^0.3.3 + acorn: ^8.8.2 commander: ^2.20.0 source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 4bb4bbee170bee4cf897545b602999e0b74d2cd035387514c6859fae6a71d623f8d1319de47bcf6a157358355cc7afaa62a5d5661bfc72968d13b35113022486 + checksum: e059177775b4d4f4cff219ad89293175aefbd1b081252270444dc83e42a2c5f07824eb2a85eae6e22ef6eb7ef04b21af36dd7d1dd7cfb93912310e57d416a205 languageName: node linkType: hard @@ -7127,6 +7703,13 @@ __metadata: languageName: node linkType: hard +"text-encoding@npm:^0.7.0": + version: 0.7.0 + resolution: "text-encoding@npm:0.7.0" + checksum: b6109a843fb1b8748b32e1ecd6df74d370f46c13ac136bcb6ca15db70209bb0b8ec1f296ebb4b0dd9961150e205dcc044b89f8cf7657f6faef78c7569a2a81bc + languageName: node + linkType: hard + "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -7198,8 +7781,8 @@ __metadata: linkType: hard "tsc-alias@npm:^1.8.2": - version: 1.8.6 - resolution: "tsc-alias@npm:1.8.6" + version: 1.8.7 + resolution: "tsc-alias@npm:1.8.7" dependencies: chokidar: ^3.5.3 commander: ^9.0.0 @@ -7209,11 +7792,11 @@ __metadata: plimit-lit: ^1.2.6 bin: tsc-alias: dist/bin/index.js - checksum: e177c155e1501a1021cec8b201be582afabb3e2651b2e44883bf18efdce7f49fe0132497ab1df1d9f3bddd6e972db15d4de148b9514c6847e05f0ddd53896286 + checksum: 77f721ea797a62a7cc74acda0baf928bb654bccb210471b63fef1e70a27a823c60f5832f51aa5976d573412bc90731e90774abf9127f3b6b13f284839f988d47 languageName: node linkType: hard -"tsconfig-paths@npm:^3.14.1": +"tsconfig-paths@npm:^3.14.2": version: 3.14.2 resolution: "tsconfig-paths@npm:3.14.2" dependencies: @@ -7233,9 +7816,9 @@ __metadata: linkType: hard "tslib@npm:^2.1.0, tslib@npm:^2.5.0": - version: 2.5.1 - resolution: "tslib@npm:2.5.1" - checksum: 535e41e956b32d21aeff007a2c74989d1a6bf3fecb2b0141d80e5b9920bf90e23b4f0cd3772704bc03637c762dbdc1a314d75a407dd7189afbe3e83d80df9392 + version: 2.6.1 + resolution: "tslib@npm:2.6.1" + checksum: b0d176d176487905b66ae4d5856647df50e37beea7571c53b8d10ba9222c074b81f1410fb91da13debaf2cbc970663609068bdebafa844ea9d69b146527c38fe languageName: node linkType: hard @@ -7287,6 +7870,42 @@ __metadata: languageName: node linkType: hard +"typed-array-buffer@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-buffer@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.1 + is-typed-array: ^1.1.10 + checksum: 3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3 + languageName: node + linkType: hard + +"typed-array-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-length@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: b03db16458322b263d87a702ff25388293f1356326c8a678d7515767ef563ef80e1e67ce648b821ec13178dd628eb2afdc19f97001ceae7a31acf674c849af94 + languageName: node + linkType: hard + +"typed-array-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-offset@npm:1.0.0" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + for-each: ^0.3.3 + has-proto: ^1.0.1 + is-typed-array: ^1.1.10 + checksum: 04f6f02d0e9a948a95fbfe0d5a70b002191fae0b8fe0fe3130a9b2336f043daf7a3dda56a31333c35a067a97e13f539949ab261ca0f3692c41603a46a94e960b + languageName: node + linkType: hard + "typed-array-length@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-length@npm:1.0.4" @@ -7315,22 +7934,22 @@ __metadata: linkType: hard "typescript@npm:^5.0.4": - version: 5.0.4 - resolution: "typescript@npm:5.0.4" + version: 5.1.6 + resolution: "typescript@npm:5.1.6" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 + checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350 languageName: node linkType: hard "typescript@patch:typescript@^5.0.4#~builtin": - version: 5.0.4 - resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=1f5320" + version: 5.1.6 + resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=1f5320" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 6a1fe9a77bb9c5176ead919cc4a1499ee63e46b4e05bf667079f11bf3a8f7887f135aa72460a4c3b016e6e6bb65a822cb8689a6d86cbfe92d22cc9f501f09213 + checksum: 21e88b0a0c0226f9cb9fd25b9626fb05b4c0f3fddac521844a13e1f30beb8f14e90bd409a9ac43c812c5946d714d6e0dee12d5d02dfc1c562c5aacfa1f49b606 languageName: node linkType: hard @@ -7353,25 +7972,25 @@ __metadata: languageName: node linkType: hard -"unique-filename@npm:^2.0.0": - version: 2.0.1 - resolution: "unique-filename@npm:2.0.1" +"unique-filename@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-filename@npm:3.0.0" dependencies: - unique-slug: ^3.0.0 - checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f + unique-slug: ^4.0.0 + checksum: 8e2f59b356cb2e54aab14ff98a51ac6c45781d15ceaab6d4f1c2228b780193dc70fae4463ce9e1df4479cb9d3304d7c2043a3fb905bdeca71cc7e8ce27e063df languageName: node linkType: hard -"unique-slug@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-slug@npm:3.0.0" +"unique-slug@npm:^4.0.0": + version: 4.0.0 + resolution: "unique-slug@npm:4.0.0" dependencies: imurmurhash: ^0.1.4 - checksum: 49f8d915ba7f0101801b922062ee46b7953256c93ceca74303bd8e6413ae10aa7e8216556b54dc5382895e8221d04f1efaf75f945c2e4a515b4139f77aa6640c + checksum: 0884b58365af59f89739e6f71e3feacb5b1b41f2df2d842d0757933620e6de08eff347d27e9d499b43c40476cbaf7988638d3acb2ffbcb9d35fd035591adfd15 languageName: node linkType: hard -"update-browserslist-db@npm:^1.0.10": +"update-browserslist-db@npm:^1.0.11": version: 1.0.11 resolution: "update-browserslist-db@npm:1.0.11" dependencies: @@ -7527,17 +8146,16 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.9": - version: 1.1.9 - resolution: "which-typed-array@npm:1.1.9" +"which-typed-array@npm:^1.1.10, which-typed-array@npm:^1.1.11": + version: 1.1.11 + resolution: "which-typed-array@npm:1.1.11" dependencies: available-typed-arrays: ^1.0.5 call-bind: ^1.0.2 for-each: ^0.3.3 gopd: ^1.0.1 has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.10 - checksum: fe0178ca44c57699ca2c0e657b64eaa8d2db2372a4e2851184f568f98c478ae3dc3fdb5f7e46c384487046b0cf9e23241423242b277e03e8ba3dabc7c84c98ef + checksum: 711ffc8ef891ca6597b19539075ec3e08bb9b4c2ca1f78887e3c07a977ab91ac1421940505a197758fb5939aa9524976d0a5bbcac34d07ed6faa75cedbb17206 languageName: node linkType: hard @@ -7572,14 +8190,7 @@ __metadata: languageName: node linkType: hard -"word-wrap@npm:^1.2.3": - version: 1.2.3 - resolution: "word-wrap@npm:1.2.3" - checksum: 30b48f91fcf12106ed3186ae4fa86a6a1842416df425be7b60485de14bec665a54a68e4b5156647dec3a70f25e84d270ca8bc8cd23182ed095f5c7206a938c1f - languageName: node - linkType: hard - -"wrap-ansi@npm:^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" dependencies: @@ -7590,6 +8201,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^8.1.0": + version: 8.1.0 + resolution: "wrap-ansi@npm:8.1.0" + dependencies: + ansi-styles: ^6.1.0 + string-width: ^5.0.1 + strip-ansi: ^7.0.1 + checksum: 371733296dc2d616900ce15a0049dca0ef67597d6394c57347ba334393599e800bab03c41d4d45221b6bc967b8c453ec3ae4749eff3894202d16800fdfe0e238 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" @@ -7637,7 +8259,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.5.0": +"ws@npm:^8.12.1, ws@npm:^8.5.0": version: 8.13.0 resolution: "ws@npm:8.13.0" peerDependencies: @@ -7720,3 +8342,19 @@ __metadata: checksum: 6810adaf6be7b6cc115ed9454e5a4e8e0949deecb107d65dc0c196051e862f04d6394ad12fbef0d51e6c730329992ae98625ba82cba5e34775023ddb6dc921b8 languageName: node linkType: hard + +"zen-observable-ts@npm:^1.1.0": + version: 1.2.5 + resolution: "zen-observable-ts@npm:1.2.5" + dependencies: + zen-observable: 0.8.15 + checksum: 3b707b7a0239a9bc40f73ba71b27733a689a957c1f364fabb9fa9cbd7d04b7c2faf0d517bf17004e3ed3f4330ac613e84c0d32313e450ddaa046f3350af44541 + languageName: node + linkType: hard + +"zen-observable@npm:0.8.15": + version: 0.8.15 + resolution: "zen-observable@npm:0.8.15" + checksum: b7289084bc1fc74a559b7259faa23d3214b14b538a8843d2b001a35e27147833f4107590b1b44bf5bc7f6dfe6f488660d3a3725f268e09b3925b3476153b7821 + languageName: node + linkType: hard