From efdb62b728b14c8865b39ffea04883b87d09b2fe Mon Sep 17 00:00:00 2001 From: Michael J Feher Date: Mon, 13 May 2024 15:32:39 -0400 Subject: [PATCH] chore: remove js clients from service repo --- .env.docker | 1 + Dockerfile | 9 +- clients/README.md | 59 - clients/liquid-auth-client-js/.eslintrc.json | 22 - clients/liquid-auth-client-js/.gitignore | 133 - clients/liquid-auth-client-js/.prettierrc | 4 - clients/liquid-auth-client-js/package.json | 69 - .../liquid-auth-client-js/public/favicon.svg | 1 - .../liquid-auth-client-js/src/assertion.ts | 207 -- .../liquid-auth-client-js/src/attestation.ts | 135 - clients/liquid-auth-client-js/src/connect.ts | 189 -- .../liquid-auth-client-js/src/constants.ts | 6 - clients/liquid-auth-client-js/src/errors.ts | 9 - clients/liquid-auth-client-js/src/index.ts | 6 - clients/liquid-auth-client-js/src/signal.ts | 287 -- .../__fixtures__/base64url.fixtures.json | 5 - .../tests/connect.spec.js | 28 - clients/liquid-auth-client-js/tsconfig.json | 12 - clients/liquid-auth-core/.eslintrc.json | 22 - clients/liquid-auth-core/.gitignore | 133 - clients/liquid-auth-core/package.json | 50 - clients/liquid-auth-core/src/index.ts | 1 - .../encoding.base64url.fixtures.json | 1079 ------ .../__fixtures__/wallet.keys.fixtures.json | 2972 ----------------- .../liquid-auth-core/tests/encoding.spec.js | 46 - .../tests/generate.fixtures.js | 61 - clients/liquid-auth-core/tsconfig.json | 13 - docker-compose.yml | 4 +- package-lock.json | 817 ++--- package.json | 5 +- services/liquid-auth-api-js/.eslintrc.json | 2 + services/liquid-auth-api-js/package.json | 5 +- .../liquid-auth-api-js/src/app.service.ts | 2 +- .../src/attestation/attestation.service.ts | 2 +- .../src/auth/auth.service.ts | 2 +- .../src/encoding}/encoding.ts | 24 +- .../src/encoding}/hi-base32.ts | 18 +- .../liquid-auth-api-js/src/encoding/index.ts | 1 + .../src/encoding}/sha512.ts | 60 +- .../liquid-auth-api-js/tests/constants.ts | 2 +- sites/dapp-ui/package.json | 2 +- sites/dapp-ui/src/App.tsx | 2 +- sites/dapp-ui/src/components/ConnectModal.tsx | 2 +- sites/dapp-ui/src/hooks/useSignalClient.ts | 2 +- sites/dapp-ui/src/pages/connected.tsx | 2 +- sites/dapp-ui/src/pages/home.tsx | 2 +- 46 files changed, 276 insertions(+), 6239 deletions(-) delete mode 100644 clients/README.md delete mode 100644 clients/liquid-auth-client-js/.eslintrc.json delete mode 100644 clients/liquid-auth-client-js/.gitignore delete mode 100644 clients/liquid-auth-client-js/.prettierrc delete mode 100644 clients/liquid-auth-client-js/package.json delete mode 100644 clients/liquid-auth-client-js/public/favicon.svg delete mode 100644 clients/liquid-auth-client-js/src/assertion.ts delete mode 100644 clients/liquid-auth-client-js/src/attestation.ts delete mode 100644 clients/liquid-auth-client-js/src/connect.ts delete mode 100644 clients/liquid-auth-client-js/src/constants.ts delete mode 100644 clients/liquid-auth-client-js/src/errors.ts delete mode 100644 clients/liquid-auth-client-js/src/index.ts delete mode 100644 clients/liquid-auth-client-js/src/signal.ts delete mode 100644 clients/liquid-auth-client-js/tests/__fixtures__/base64url.fixtures.json delete mode 100644 clients/liquid-auth-client-js/tests/connect.spec.js delete mode 100644 clients/liquid-auth-client-js/tsconfig.json delete mode 100644 clients/liquid-auth-core/.eslintrc.json delete mode 100644 clients/liquid-auth-core/.gitignore delete mode 100644 clients/liquid-auth-core/package.json delete mode 100644 clients/liquid-auth-core/src/index.ts delete mode 100644 clients/liquid-auth-core/tests/__fixtures__/encoding.base64url.fixtures.json delete mode 100644 clients/liquid-auth-core/tests/__fixtures__/wallet.keys.fixtures.json delete mode 100644 clients/liquid-auth-core/tests/encoding.spec.js delete mode 100644 clients/liquid-auth-core/tests/generate.fixtures.js delete mode 100644 clients/liquid-auth-core/tsconfig.json rename {clients/liquid-auth-core/src => services/liquid-auth-api-js/src/encoding}/encoding.ts (84%) rename {clients/liquid-auth-core/src => services/liquid-auth-api-js/src/encoding}/hi-base32.ts (95%) create mode 100644 services/liquid-auth-api-js/src/encoding/index.ts rename {clients/liquid-auth-core/src => services/liquid-auth-api-js/src/encoding}/sha512.ts (98%) diff --git a/.env.docker b/.env.docker index f19032b..bad413b 100644 --- a/.env.docker +++ b/.env.docker @@ -1,6 +1,7 @@ # Application NODE_ENV=production SENTRY_DNS= +PORT=5173 # Database DB_HOST=mongo:27017 diff --git a/Dockerfile b/Dockerfile index 039751c..cc21917 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:20.12-alpine AS BUILDER +ENV PYTHONUNBUFFERED=1 +RUN apk add --update --no-cache g++ make py3-pip pkgconfig pixman-dev cairo-dev pango-dev && ln -sf python3 /usr/bin/python + COPY . . RUN npm ci @@ -12,17 +15,13 @@ FROM node:20.12-alpine COPY --from=BUILDER ./node_modules ./node_modules COPY --from=BUILDER ./package.json ./package.json COPY --from=BUILDER ./package-lock.json ./package-lock.json -# Client Files -COPY --from=BUILDER ./clients ./clients # Sites Files COPY --from=BUILDER ./sites ./sites # Service Files COPY --from=BUILDER ./services/liquid-auth-api-js/ ./services/liquid-auth-api-js/ - -RUN npm ci --production - # Expose the port on which the app will run EXPOSE 3000 +EXPOSE 5173 CMD ["npm", "run", "start"] diff --git a/clients/README.md b/clients/README.md deleted file mode 100644 index 39b6d7f..0000000 --- a/clients/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Overview - -Client JSON-RPC interfaces are generated from OpenAPI 3.0 specifications. -All clients should mirror the same interfaces and include the same parameters (as much as possible). - -```typescript -interface SignalClient { - readonly url: string; // Origin of the service - type: "offer" | "answer" // Type of client - peerClient: RTCPeerConnection | PeerClient // Native WebRTC Wrapper/Interface - socket: Socket // The socket to the service - - readonly authenticated: boolean; // State of authentication - readonly requestId?: string; // The current request being signaled - - /** - * Generate a Request ID - */ - generateRequestId(): any; - - /** - * Top level Friendly interface for signaling - * @param args - */ - peer(requestId: any, type: 'offer' | 'answer', config?: RTCConfiguration): Promise; - - /** - * Link a Request ID to this client - * @param args - */ - link(...args: any[]): Promise; - - /** - * Wait for a desciption signal - * @param args - */ - signal(...args: any[]): Promise; - - /** - * Terminate the signaling session - */ - close(): void - - - /** - * Listen to Interface events - * @param args - */ - on(...args: any[]): void; - - /** - * Emit an event to the interface - * @param channel - * @param callback - */ - emit(channel: string, callback: (...args: any[])=>void) - -} -``` diff --git a/clients/liquid-auth-client-js/.eslintrc.json b/clients/liquid-auth-client-js/.eslintrc.json deleted file mode 100644 index 14bfcde..0000000 --- a/clients/liquid-auth-client-js/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint/eslint-plugin", - "eslint-plugin-tsdoc" - ], - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "warn" - } -} diff --git a/clients/liquid-auth-client-js/.gitignore b/clients/liquid-auth-client-js/.gitignore deleted file mode 100644 index e1be502..0000000 --- a/clients/liquid-auth-client-js/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ -lib -docs - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* diff --git a/clients/liquid-auth-client-js/.prettierrc b/clients/liquid-auth-client-js/.prettierrc deleted file mode 100644 index dcb7279..0000000 --- a/clients/liquid-auth-client-js/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "all" -} \ No newline at end of file diff --git a/clients/liquid-auth-client-js/package.json b/clients/liquid-auth-client-js/package.json deleted file mode 100644 index ff67089..0000000 --- a/clients/liquid-auth-client-js/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@liquid/auth-client", - "version": "1.0.0", - "description": "Connect to Algorand Dapp", - "main": "./lib/index.js", - "type": "module", - "exports": { - ".": { - "default": "./lib/index.js", - "types": "./lib/index.d.ts" - }, - "./attestation": { - "default": "./lib/attestation.js", - "types": "./lib/attestation.d.ts" - }, - "./assertion": { - "default": "./lib/assertion.js", - "types": "./lib/assertion.d.ts" - }, - "./connect": { - "default": "./lib/connect.js", - "types": "./lib/connect.d.ts" - }, - "./signal": { - "default": "./lib/signal.js", - "types": "./lib/signal.d.ts" - }, - "./errors": { - "default": "./lib/errors.js", - "types": "./lib/errors.d.ts" - } - }, - "scripts": { - "dev": "tsc --watch", - "build": "tsc", - "build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src src/client", - "lint": "eslint --fix src", - "test:ts": "node --import tsx --test ./src/client/*.spec.ts", - "test": "tsc && node --test ./tests/*.spec.js", - "test:cov": "tsc && c8 node --test ./tests/*.spec.js" - }, - "author": "", - "license": "MIT", - "devDependencies": { - "@swc/register": "^0.1.10", - "@types/chai": "^4.3.14", - "@types/qrcode": "^1.5.5", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^7.6.0", - "algosdk": "^2.7.0", - "c8": "^9.1.0", - "chai": "^5.1.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-tsdoc": "^0.2.17", - "tsx": "^4.7.2", - "typedoc": "^0.25.13", - "typedoc-plugin-markdown": "^4.0.0-next.55", - "typescript": "^5.4.5" - }, - "dependencies": { - "@liquid/core": "^1.0.0", - "eventemitter3": "^5.0.1", - "isomorphic-fetch": "^3.0.0", - "qr-code-styling": "^1.6.0-rc.1", - "tweetnacl": "^1.0.3" - } -} diff --git a/clients/liquid-auth-client-js/public/favicon.svg b/clients/liquid-auth-client-js/public/favicon.svg deleted file mode 100644 index cba5ac1..0000000 --- a/clients/liquid-auth-client-js/public/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/clients/liquid-auth-client-js/src/assertion.ts b/clients/liquid-auth-client-js/src/assertion.ts deleted file mode 100644 index 29ac125..0000000 --- a/clients/liquid-auth-client-js/src/assertion.ts +++ /dev/null @@ -1,207 +0,0 @@ -/** - * This module is only for browser and currently not used in the project. - * However, it could be useful for extension wallets or other browser-based wallets. - */ -import { fromBase64Url, toBase64URL } from '@liquid/core/encoding'; -import { DEFAULT_FETCH_OPTIONS } from './constants.js'; -import { - isValidResponse, - INVALID_INPUT_MESSAGE, - CREDENTIAL_ACTION_FAILURE, -} from './errors.js'; - -export type EncodedPublicKeyCredentialDescriptor = - PublicKeyCredentialDescriptor & { - id: string; - }; -export type EncodedPublicKeyCredentialRequestOptions = - PublicKeyCredentialRequestOptions & { - allowCredentials?: EncodedPublicKeyCredentialDescriptor[]; - challenge: string; - }; -/** - * Fetch Assertion Options - * - * POST Authenticator Selector to the REST API - * to receive the PublicKeyCredentialRequestOptions - * - * @param origin - * @param credId - * @todo: Generate Typed JSON-RPC clients from Swagger/OpenAPI - */ -export async function fetchAssertionRequestOptions( - origin: string, - credId: string, -) { - if (typeof origin !== 'string' || typeof credId !== 'string') { - throw new TypeError(INVALID_INPUT_MESSAGE); - } - return await fetch(`/assertion/request/${credId}`, { - ...DEFAULT_FETCH_OPTIONS, - }).then((r) => { - if (!isValidResponse(r)) { - throw new Error(r.statusText); - } - return r.json() as Promise; - }); -} -/** - * Decode Assertion Request Options - * - * @param options - */ -export function decodeAssertionRequestOptions( - options: EncodedPublicKeyCredentialRequestOptions, -) { - if (typeof options !== 'object' || typeof options.challenge !== 'string') - throw new TypeError(INVALID_INPUT_MESSAGE); - - const decodedOptions: PublicKeyCredentialRequestOptions = { ...options }; - decodedOptions.challenge = fromBase64Url(options.challenge as string); - decodedOptions.allowCredentials = - options.allowCredentials?.map( - (cred: EncodedPublicKeyCredentialDescriptor) => { - return { - ...cred, - id: fromBase64Url(cred.id as string), - } as PublicKeyCredentialDescriptor; - }, - ) || []; - return decodedOptions; -} - -export type EncodedAuthenticatorAssertionResponse = { - [k: string]: string; - clientDataJSON: string; - authenticatorData: string; - signature: string; - userHandle: string; -}; -export type EncodedCredential = { - [k: string]: string | EncodedAuthenticatorAssertionResponse; - id: string; - type: string; - response: EncodedAuthenticatorAssertionResponse; - rawId: string; -}; - -/** - * Fetch Assertion Response - * - * POST an Authenticator Assertion Response to the REST API - * - * @param origin - * @param credential - * @todo: Generate Typed JSON-RPC clients from Swagger/OpenAPI - */ -export async function fetchAssertionResponse( - origin: string, - credential: EncodedCredential, -) { - if (typeof origin !== 'string' || typeof credential !== 'object') { - // TODO: instance check for SerializedCredential - throw new TypeError(INVALID_INPUT_MESSAGE); - } - return await fetch(`${origin}/assertion/response`, { - ...DEFAULT_FETCH_OPTIONS, - body: JSON.stringify(credential), - }).then((r) => { - if (!isValidResponse(r)) { - throw new Error(r.statusText); - } - return r.json(); - }); -} -/** - * - * @param response - */ -export function encodeAuthenticatorAssertionResponse( - response: AuthenticatorAssertionResponse & Record, -) { - return Object.keys( - AuthenticatorAssertionResponse.prototype, - ).reduce( - (prev, curr) => { - prev[curr] = toBase64URL(response[curr]); - return prev; - }, - { - clientDataJSON: toBase64URL(response.clientDataJSON), - } as EncodedAuthenticatorAssertionResponse, - ); -} - -/** - * - * @param credential - */ -export function encodeCredential( - credential: PublicKeyCredential, -): EncodedCredential { - if (!credential) throw new Error(INVALID_INPUT_MESSAGE); - const response = credential.response as AuthenticatorAssertionResponse & - Record; - if (!response) throw new Error(CREDENTIAL_ACTION_FAILURE); - return { - id: credential.id, - type: credential.type, - rawId: toBase64URL(credential.rawId), - response: encodeAuthenticatorAssertionResponse(response), - }; -} - -/** - * Assert a known credential - * @param origin - * @param credId - * @param debug - */ -export async function assertion( - origin: string, - credId: string, - debug: boolean = false, -) { - if (typeof credId !== 'string') { - throw new TypeError(INVALID_INPUT_MESSAGE); - } - debug && - console.log( - `%cFETCHING: %c/assertion/request/${credId}`, - 'color: yellow', - 'color: cyan', - ); - - const options = await fetchAssertionRequestOptions(origin, credId).then( - decodeAssertionRequestOptions, - ); - - if (options.allowCredentials.length === 0) { - debug && console.info('No registered credentials found.'); - return null; - } - - debug && - console.log( - '%cGET_CREDENTIAL:%c navigator.credentials.get', - 'color: yellow', - 'color: cyan', - options, - ); - - const credential = await navigator.credentials - .get({ - publicKey: options, - }) - .then(encodeCredential); - - debug && - console.log( - '%cPOSTING: %c/assertion/response', - 'color: yellow', - 'color: cyan', - credential, - ); - - return fetchAssertionResponse(origin, credential); -} diff --git a/clients/liquid-auth-client-js/src/attestation.ts b/clients/liquid-auth-client-js/src/attestation.ts deleted file mode 100644 index 04385af..0000000 --- a/clients/liquid-auth-client-js/src/attestation.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * This module is only for browser and currently not used in the project. - * However, it could be useful for extension wallets or other browser-based wallets. - */ -import { fromBase64Url, toBase64URL } from '@liquid/core/encoding'; -import { DEFAULT_FETCH_OPTIONS } from './constants.js'; -import { isValidResponse } from './errors.js'; - -export const DEFAULT_ATTESTATION_OPTIONS = { - attestationType: 'none', - authenticatorSelection: { - authenticatorAttachment: 'platform', - userVerification: 'required', - requireResidentKey: false, - }, -}; -export interface EncodedAuthenticatorAttestationResponse { - [k: string]: string | undefined; - clientDataJSON: string; - attestationObject: string; - signature?: string; - userHandle?: string; -} -export interface EncodedAttestationCredential { - [k: string]: string | EncodedAuthenticatorAttestationResponse; - id: string; - type: string; - response: EncodedAuthenticatorAttestationResponse; - rawId: string; -} - -/** - * Encode a PublicKeyCredential - * - * @param credential - PublicKeyCredential from navigator.credentials.create - */ -function encodeAttestationCredential( - credential: PublicKeyCredential, -): EncodedAttestationCredential { - const response = credential.response as AuthenticatorAttestationResponse; - return { - id: credential.id, - rawId: toBase64URL(credential.rawId), - type: credential.type, - response: { - clientDataJSON: toBase64URL(response.clientDataJSON), - attestationObject: toBase64URL(response.attestationObject), - }, - }; -} - -function decodeAttestationOptions(options) { - const attestationOptions = { ...options }; - attestationOptions.user.id = fromBase64Url(options.user.id); - attestationOptions.challenge = fromBase64Url(options.challenge); - - if (attestationOptions.excludeCredentials) { - for (const cred of attestationOptions.excludeCredentials) { - cred.id = fromBase64Url(cred.id); - } - } - - return attestationOptions; -} - -/** - * Fetch interface for Attestation Options - * - * @param origin - * @param options - * @todo: Generate Typed JSON-RPC clients from Swagger/OpenAPI - */ -export async function fetchAttestationRequest( - origin: string, - options = DEFAULT_ATTESTATION_OPTIONS, -) { - return await fetch(`${origin}/attestation/request`, { - ...DEFAULT_FETCH_OPTIONS, - body: JSON.stringify(options), - }); -} - -/** - * Fetch interface for Attestation Response - * - * @param origin - * @param credential - * @todo: Generate Typed JSON-RPC clients from Swagger/OpenAPI - */ -export async function fetchAttestationResponse( - origin: string, - credential: EncodedAttestationCredential, -) { - return await fetch(`${origin}/attestation/response`, { - ...DEFAULT_FETCH_OPTIONS, - body: JSON.stringify(credential), - }).then((r) => { - if (!isValidResponse(r)) throw new Error(r.statusText); - return r.json(); - }); -} - -/** - * Attestation - * - * The process of creating a new credential. It has two parts: - * - * - The server creates a challenge and sends it to the client - * - The client creates a credential and sends it to the server - * - */ -export async function attestation( - origin: string, - options = DEFAULT_ATTESTATION_OPTIONS, -) { - const encodedAttestationOptions = await fetchAttestationRequest( - origin, - options, - ).then((r) => { - if (!isValidResponse(r)) throw new Error(r.statusText); - return r.json(); - }); - - if (typeof encodedAttestationOptions.error !== 'undefined') { - throw new Error(encodedAttestationOptions.error); - } - - const credential = encodeAttestationCredential( - (await navigator.credentials.create({ - publicKey: decodeAttestationOptions(encodedAttestationOptions), - })) as PublicKeyCredential, - ); - - return await fetchAttestationResponse(origin, credential); -} diff --git a/clients/liquid-auth-client-js/src/connect.ts b/clients/liquid-auth-client-js/src/connect.ts deleted file mode 100644 index e72cf38..0000000 --- a/clients/liquid-auth-client-js/src/connect.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * This module is deprecated - */ -import { DEFAULT_FETCH_OPTIONS } from './constants.js'; -import type { Account } from 'algosdk'; -import type { SignKeyPair } from 'tweetnacl'; -import nacl from 'tweetnacl'; -import { toBase64URL, encodeAddress } from '@liquid/core/encoding'; -import { - INVALID_INPUT_MESSAGE, - isValidResponse, - UNSIGNED_MESSAGE, -} from './errors.js'; - -/** - * @todo: Refactor auth message to FIDO extension - * @deprecated - */ -export class Message { - /** - * Origin of the Request - */ - origin: string; - /** - * Challenge to be signed - */ - challenge: string; - /** - * Linking Request ID - */ - requestId: number; - /** - * Label for the remote Service - */ - label?: string; - /** - * Address that signed the message - */ - wallet?: string; - /** - * Signature of the challenge - */ - signature?: string; - constructor( - origin: string, - challenge: string, - requestId: number, - label?: string, - ) { - this.origin = origin; - this.challenge = challenge; - this.requestId = requestId; - this.label = label; - } - - static async fromResponse(response: Response | Message) { - const msg = response instanceof Response ? await response.json() : response; - return new Message(msg.origin, msg.challenge, msg.requestId); - } - - /** - * Sign Message with Wallet Key - * - * @param key - * @deprecated - */ - sign(key: string | Account | Uint8Array | SignKeyPair): this { - const encoder = new TextEncoder(); - let keyPair: SignKeyPair | null = null; - - // Seed or Secret Key - if (key instanceof Uint8Array) { - if (key.length === 32) { - keyPair = nacl.sign.keyPair.fromSeed(key); - } else if (key.length === 64) { - keyPair = nacl.sign.keyPair.fromSecretKey(key); - } else { - throw new TypeError('Invalid seed or secret key'); - } - } - - // Algorand SDK - if ( - typeof (key as Account).addr !== 'undefined' && - typeof (key as Account).addr === 'string' - ) { - keyPair = nacl.sign.keyPair.fromSecretKey((key as Account).sk); - } - - // NACL - if ( - (key as SignKeyPair).publicKey instanceof Uint8Array && - (key as SignKeyPair).secretKey instanceof Uint8Array - ) { - console.log('nacl'); - keyPair = key as SignKeyPair; - } - if (keyPair === null) { - throw new TypeError('Invalid key'); - } - this.signature = toBase64URL( - nacl.sign.detached(encoder.encode(this.challenge), keyPair.secretKey), - ); - this.wallet = encodeAddress(keyPair.publicKey); - return this; - } - - toString(): string { - const optional: { wallet?: string; signature?: string; label?: string } = - {}; - - if (typeof this.wallet === 'string') { - optional.wallet = this.wallet; - } - - if (typeof this.signature === 'string') { - optional.signature = this.signature; - } - - if (typeof this.label === 'string') { - optional.label = this.label; - } - - return JSON.stringify({ - origin: this.origin, - requestId: this.requestId, - challenge: this.challenge, - ...optional, - }); - } -} - -/** - * - * @deprecated - * @param origin - * @param requestId - */ -export async function fetchConnectRequest(origin: string, requestId: number) { - if (typeof origin !== 'string' || typeof requestId !== 'number') - throw new TypeError(INVALID_INPUT_MESSAGE); - return await fetch(`${origin}/connect/request`, { - ...DEFAULT_FETCH_OPTIONS, - body: JSON.stringify({ requestId }), - }); -} - -/** - * @deprecated - * @param msg - */ -export async function fetchConnectResponse(msg: Message) { - if (!(msg instanceof Message)) throw new TypeError(INVALID_INPUT_MESSAGE); - if (typeof msg.signature === 'undefined') { - throw new TypeError(UNSIGNED_MESSAGE); - } - return await fetch('/connect/response', { - ...DEFAULT_FETCH_OPTIONS, - body: JSON.stringify(msg), - }).then((r) => { - if (!isValidResponse(r)) throw new Error(r.statusText); - return r.json(); - }); -} - -/** - * Connect - * @param origin - * @param requestId - * @param key - * @deprecated - */ -export async function connect( - origin: string, - requestId: number, - key: string | Account | Uint8Array | SignKeyPair, -) { - if ( - typeof origin !== 'string' || - typeof requestId !== 'number' || - typeof key === 'undefined' - ) - throw new TypeError(INVALID_INPUT_MESSAGE); - const msg = await Message.fromResponse( - await fetchConnectRequest(origin, requestId), - ); - msg.sign(key); - return await fetchConnectResponse(msg); -} diff --git a/clients/liquid-auth-client-js/src/constants.ts b/clients/liquid-auth-client-js/src/constants.ts deleted file mode 100644 index c1327e5..0000000 --- a/clients/liquid-auth-client-js/src/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const DEFAULT_FETCH_OPTIONS = { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, -}; diff --git a/clients/liquid-auth-client-js/src/errors.ts b/clients/liquid-auth-client-js/src/errors.ts deleted file mode 100644 index ec7d96c..0000000 --- a/clients/liquid-auth-client-js/src/errors.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const INVALID_INPUT_MESSAGE = 'Invalid input'; -export const INVALID_RESPONSE_MESSAGE = 'Invalid response'; -export const CREDENTIAL_ACTION_FAILURE = 'Credential action failed'; -export const UNSIGNED_MESSAGE = 'Message must be signed'; -export class ServiceError extends Error {} - -export function isValidResponse(r: Response) { - return r.ok && (r.status === 200 || r.status === 201); -} diff --git a/clients/liquid-auth-client-js/src/index.ts b/clients/liquid-auth-client-js/src/index.ts deleted file mode 100644 index 9cccec6..0000000 --- a/clients/liquid-auth-client-js/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './assertion.js'; -export * from './attestation.js'; -export * from './connect.js'; -export * from './constants.js'; -export * from './errors.js'; -export * from './signal.js'; diff --git a/clients/liquid-auth-client-js/src/signal.ts b/clients/liquid-auth-client-js/src/signal.ts deleted file mode 100644 index fb54b0a..0000000 --- a/clients/liquid-auth-client-js/src/signal.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { io, ManagerOptions, Socket, SocketOptions } from 'socket.io-client'; -import QRCodeStyling, { Options as QRCodeOptions } from 'qr-code-styling'; -import { EventEmitter } from 'eventemitter3'; -import { toBase64URL } from '@liquid/core'; -import nacl from 'tweetnacl'; - -export type LinkMessage = { - credId?: string; - requestId: string | number; - wallet: string; -}; -export const REQUEST_IS_MISSING_MESSAGE = 'Request id is required'; -export const REQUEST_IN_PROCESS_MESSAGE = 'Request in process'; -export const UNAUTHENTICATED_MESSAGE = 'Not authenticated'; - -export const DEFAULT_QR_CODE_OPTIONS: QRCodeOptions = { - width: 500, - height: 500, - data: 'algorand://', - margin: 25, - imageOptions: { hideBackgroundDots: true, imageSize: 0.4, margin: 15 }, - dotsOptions: { - type: 'extra-rounded', - gradient: { - type: 'radial', - rotation: 0, - colorStops: [ - { offset: 0, color: '#9966ff' }, - { offset: 1, color: '#332257' }, - ], - }, - }, - backgroundOptions: { color: '#ffffff', gradient: null }, - // TODO: Host logo publicly - image: '/logo.png', - cornersSquareOptions: { - color: '#000000', - gradient: { - type: 'linear', - rotation: 0, - colorStops: [ - { offset: 0, color: '#332257' }, - { offset: 1, color: '#040908' }, - ], - }, - }, - cornersDotOptions: { - type: 'dot', - color: '#000000', - gradient: { - type: 'linear', - rotation: 0, - colorStops: [ - { offset: 0, color: '#000000' }, - { offset: 1, color: '#000000' }, - ], - }, - }, -}; - -export async function generateQRCode( - { requestId, url }: { requestId: any; url: string }, - qrCodeOptions: QRCodeOptions = DEFAULT_QR_CODE_OPTIONS, -) { - if (requestId === 'undefined') throw new Error(REQUEST_IS_MISSING_MESSAGE); - // TODO: Serialize data to standard URL for Deep-Links - qrCodeOptions.data = JSON.stringify({ - requestId: requestId, - origin: url, - // TODO: Remove challenge from QR Code - challenge: toBase64URL(nacl.randomBytes(nacl.sign.seedLength)), - }); - - // @ts-expect-error, figure out call signature issue - const qrCode = new QRCodeStyling(qrCodeOptions); - return qrCode.getRawData('png').then((blob) => { - if (!blob) throw new TypeError('Could not get qrcode blob'); - return URL.createObjectURL(blob); - }); -} - -/** - * - */ -export class SignalClient extends EventEmitter { - private url: string; - type: 'offer' | 'answer'; - private authenticated: boolean = false; - private requestId: any | undefined; - peerClient: RTCPeerConnection | undefined; - private qrCodeOptions: QRCodeOptions = DEFAULT_QR_CODE_OPTIONS; - socket: Socket; - - /** - * - * @param url - * @param options - */ - constructor( - url: string, - options: Partial = { autoConnect: true }, - ) { - super(); - this.url = url; - this.socket = io(url, options); - globalThis.socket = this.socket; - this.socket.on('connect', () => { - this.emit('connect', this.socket.id); - }); - - this.socket.on('disconnect', () => { - this.emit('disconnect', this.socket.id); - }); - } - - static generateRequestId() { - //TODO: replace with toBase64URL(nacl.randomBytes(nacl.sign.seedLength) - return Math.random(); - } - - /** - * Create QR Code - */ - async qrCode() { - if (typeof this.requestId === 'undefined') - throw new Error(REQUEST_IS_MISSING_MESSAGE); - // TODO: Serialize data to standard URL for Deep-Links - this.qrCodeOptions.data = JSON.stringify({ - requestId: this.requestId, - origin: this.url, - // TODO: Remove challenge from QR Code - challenge: toBase64URL(nacl.randomBytes(nacl.sign.seedLength)), - }); - return generateQRCode( - { requestId: this.requestId, url: this.url }, - this.qrCodeOptions, - ); - } - - /** - * # Create a peer connection - * - * Send the nonce to the server and listen to a specified type. - * - * ## Offer - * - Will wait for an offer-description from the server - * - Will send an answer-description to the server - * - Will send candidates to the server - * - * ## Answer - * - Will send an offer-description to the server - * - Will wait for an answer-description from the server - * - Will send candidates to the server - * - * @param requestId - * @param type - * @param config - */ - async peer( - requestId: any, - type: 'offer' | 'answer', - config?: RTCConfiguration, - ): Promise { - if (typeof this.requestId !== 'undefined') - throw new Error(REQUEST_IN_PROCESS_MESSAGE); - - return new Promise(async (resolve) => { - let candidatesBuffer = []; - // Create Peer Connection - this.peerClient = new RTCPeerConnection(config); - globalThis.peerClient = this.peerClient; - this.type = type === 'offer' ? 'answer' : 'offer'; - // Wait for a link message - await this.link(requestId); - // Listen for Local Candidates - this.peerClient.onicecandidate = (event) => { - if (event.candidate) { - this.emit(`${this.type}-candidate`, event.candidate.toJSON()); - this.socket.emit(`${this.type}-candidate`, event.candidate.toJSON()); - } - }; - // Listen to Remote Candidates - this.socket.on( - `${type}-candidate`, - async (candidate: RTCIceCandidateInit) => { - if ( - this.peerClient.remoteDescription && - this.peerClient.remoteDescription - ) { - this.emit(`${type}-candidate`, candidate); - await this.peerClient.addIceCandidate( - new RTCIceCandidate(candidate), - ); - } else { - candidatesBuffer.push(candidate); - } - }, - ); - - // Listen for Remote DataChannel and Resolve - this.peerClient.ondatachannel = (event) => { - console.log(event); - globalThis.dc = event.channel; - this.emit('data-channel', event.channel); - resolve(event.channel); - }; - // Handle Session Descriptions - if (type === 'offer') { - const sdp = await this.signal(type); - await this.peerClient.setRemoteDescription(sdp); - const answer = await this.peerClient.createAnswer(); - await this.peerClient.setLocalDescription(answer); - if (candidatesBuffer.length > 0) { - await Promise.all( - candidatesBuffer.map(async (candidate) => { - this.emit(`${type}-candidate`, candidate); - await this.peerClient.addIceCandidate( - new RTCIceCandidate(candidate), - ); - }), - ); - candidatesBuffer = []; - } - this.emit(`${this.type}-description`, answer.sdp); - this.socket.emit(`${this.type}-description`, answer.sdp); - } else { - const localSdp = await this.peerClient.createOffer(); - const dataChannel = this.peerClient.createDataChannel('liquid'); - await this.peerClient.setLocalDescription(localSdp); - this.socket.emit(`${this.type}-description`, localSdp.sdp); - const sdp = await this.signal(type); - await this.peerClient.setRemoteDescription(sdp); - this.emit('data-channel', dataChannel); - resolve(dataChannel); - } - }); - } - - /** - * Await for a link message for a given requestId - * @param requestId - */ - async link(requestId: any) { - if (typeof this.requestId !== 'undefined') - throw new Error(REQUEST_IN_PROCESS_MESSAGE); - this.requestId = requestId; - this.emit('link', { requestId }); - - return new Promise((resolve) => { - this.socket.emit( - 'link', - { requestId }, - ({ data }: { data: LinkMessage }) => { - this.authenticated = true; - delete this.requestId; - - this.emit('link-message', data); - resolve(data); - }, - ); - }); - } - - /** - * - * @param type - */ - async signal(type: 'offer' | 'answer') { - if (!this.authenticated) throw new Error(UNAUTHENTICATED_MESSAGE); - this.emit('signal', { type }); - return new Promise((resolve) => { - this.socket.once(`${type}-description`, (sdp: string) => { - const description = { type, sdp } as RTCSessionDescriptionInit; - this.emit(`${type}-description`, description); - resolve(description); - }); - }); - } - - close(disconnect = false) { - this.socket.removeAllListeners(); - delete this.requestId; - this.authenticated = false; - if (disconnect) this.socket.disconnect(); - this.emit('close'); - } -} diff --git a/clients/liquid-auth-client-js/tests/__fixtures__/base64url.fixtures.json b/clients/liquid-auth-client-js/tests/__fixtures__/base64url.fixtures.json deleted file mode 100644 index 8c6c516..0000000 --- a/clients/liquid-auth-client-js/tests/__fixtures__/base64url.fixtures.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - [ - "" - ] -] diff --git a/clients/liquid-auth-client-js/tests/connect.spec.js b/clients/liquid-auth-client-js/tests/connect.spec.js deleted file mode 100644 index e3cf1e6..0000000 --- a/clients/liquid-auth-client-js/tests/connect.spec.js +++ /dev/null @@ -1,28 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert'; -import algosdk from 'algosdk'; -import nacl from "tweetnacl"; - -import { Message } from '../lib/connect.js'; -import { fromBase64Url } from "@liquid/core/encoding"; -const encoder = new TextEncoder; -test("create instance", async () => { - const msg = new Message("hello", "1234", 1234); - assert(msg instanceof Message); - const acct = algosdk.generateAccount(); - // Get KeyPair - const seed = acct.sk.slice(0, 32); - const keyPair = nacl.sign.keyPair.fromSeed(seed); - // Sign with sdk secret key - msg.sign(acct.sk); - assert(nacl.sign.detached.verify(encoder.encode("1234"), fromBase64Url(msg.signature), keyPair.publicKey)); - // Sign with Seed - msg.sign(seed); - assert(nacl.sign.detached.verify(encoder.encode("1234"), fromBase64Url(msg.signature), keyPair.publicKey)); - // Sign with NACL keypair - msg.sign(keyPair); - assert(nacl.sign.detached.verify(encoder.encode("1234"), fromBase64Url(msg.signature), keyPair.publicKey)); - // Sign with algosdk Account - msg.sign(acct); - assert(nacl.sign.detached.verify(encoder.encode("1234"), fromBase64Url(msg.signature), keyPair.publicKey)); -}); diff --git a/clients/liquid-auth-client-js/tsconfig.json b/clients/liquid-auth-client-js/tsconfig.json deleted file mode 100644 index 77c36d8..0000000 --- a/clients/liquid-auth-client-js/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "include": ["./src/**/*.ts"], - "compilerOptions": { - "outDir": "lib", - "declaration": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowSyntheticDefaultImports": true, - "skipLibCheck": true, - "allowJs": true - } -} diff --git a/clients/liquid-auth-core/.eslintrc.json b/clients/liquid-auth-core/.eslintrc.json deleted file mode 100644 index cb00282..0000000 --- a/clients/liquid-auth-core/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint/eslint-plugin" - ], - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" - ], - "rules": { - "@typescript-eslint/no-explicit-any": "warn", - "no-var": "warn" - } -} diff --git a/clients/liquid-auth-core/.gitignore b/clients/liquid-auth-core/.gitignore deleted file mode 100644 index e1be502..0000000 --- a/clients/liquid-auth-core/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ -lib -docs - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* diff --git a/clients/liquid-auth-core/package.json b/clients/liquid-auth-core/package.json deleted file mode 100644 index 7647365..0000000 --- a/clients/liquid-auth-core/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@liquid/core", - "version": "1.0.0", - "description": "Utilities for Liquid Auth JS", - "main": "./lib/index.js", - "type": "module", - "exports": { - ".": { - "default": "./lib/index.js", - "types": "./lib/index.d.ts" - }, - "./hi-base32": { - "default": "./lib/hi-base32.js", - "types": "./lib/hi-base32.d.ts" - }, - "./sha512": { - "default": "./lib/sha512.js", - "types": "./lib/sha512.d.ts" - }, - "./encoding": { - "default": "./lib/encoding.js", - "types": "./lib/encoding.d.ts" - } - }, - "scripts": { - "dev": "tsc --watch", - "build": "tsc", - "build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src", - "lint": "eslint --fix src", - "test": "tsc && node --test ./tests/*.spec.js", - "test:cov": "tsc && c8 node --test ./tests/*.spec.js" - }, - "author": "", - "license": "MIT", - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^7.6.0", - "c8": "^9.1.0", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-tsdoc": "^0.2.17", - "typedoc": "^0.25.13", - "typedoc-plugin-markdown": "^4.0.0-next.55", - "typescript": "^5.4.5" - }, - "dependencies": { - "tweetnacl": "^1.0.3" - } -} diff --git a/clients/liquid-auth-core/src/index.ts b/clients/liquid-auth-core/src/index.ts deleted file mode 100644 index a443d34..0000000 --- a/clients/liquid-auth-core/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./encoding.js"; diff --git a/clients/liquid-auth-core/tests/__fixtures__/encoding.base64url.fixtures.json b/clients/liquid-auth-core/tests/__fixtures__/encoding.base64url.fixtures.json deleted file mode 100644 index cf14ba0..0000000 --- a/clients/liquid-auth-core/tests/__fixtures__/encoding.base64url.fixtures.json +++ /dev/null @@ -1,1079 +0,0 @@ -[ - { - "origin": "9b1a1b53-0456-4fcd-b10a-4db40352d58a", - "toBase64Url": "OWIxYTFiNTMtMDQ1Ni00ZmNkLWIxMGEtNGRiNDAzNTJkNThh", - "fromBase64Url": [ - 57, - 98, - 49, - 97, - 49, - 98, - 53, - 51, - 45, - 48, - 52, - 53, - 54, - 45, - 52, - 102, - 99, - 100, - 45, - 98, - 49, - 48, - 97, - 45, - 52, - 100, - 98, - 52, - 48, - 51, - 53, - 50, - 100, - 53, - 56, - 97 - ] - }, - { - "origin": "7646809", - "toBase64Url": "NzY0NjgwOQ", - "fromBase64Url": [ - 55, - 54, - 52, - 54, - 56, - 48, - 57 - ] - }, - { - "origin": "b1338059", - "toBase64Url": "YjEzMzgwNTk", - "fromBase64Url": [ - 98, - 49, - 51, - 51, - 56, - 48, - 53, - 57 - ] - }, - { - "origin": "582bd065-f280-4574-b315-3398c75296c5", - "toBase64Url": "NTgyYmQwNjUtZjI4MC00NTc0LWIzMTUtMzM5OGM3NTI5NmM1", - "fromBase64Url": [ - 53, - 56, - 50, - 98, - 100, - 48, - 54, - 53, - 45, - 102, - 50, - 56, - 48, - 45, - 52, - 53, - 55, - 52, - 45, - 98, - 51, - 49, - 53, - 45, - 51, - 51, - 57, - 56, - 99, - 55, - 53, - 50, - 57, - 54, - 99, - 53 - ] - }, - { - "origin": "29572cc5-7c36-4016-9825-abcc9ba51dae", - "toBase64Url": "Mjk1NzJjYzUtN2MzNi00MDE2LTk4MjUtYWJjYzliYTUxZGFl", - "fromBase64Url": [ - 50, - 57, - 53, - 55, - 50, - 99, - 99, - 53, - 45, - 55, - 99, - 51, - 54, - 45, - 52, - 48, - 49, - 54, - 45, - 57, - 56, - 50, - 53, - 45, - 97, - 98, - 99, - 99, - 57, - 98, - 97, - 53, - 49, - 100, - 97, - 101 - ] - }, - { - "origin": "2ce09bdf-69d1-4b08-b93e-3af4ca6a657a", - "toBase64Url": "MmNlMDliZGYtNjlkMS00YjA4LWI5M2UtM2FmNGNhNmE2NTdh", - "fromBase64Url": [ - 50, - 99, - 101, - 48, - 57, - 98, - 100, - 102, - 45, - 54, - 57, - 100, - 49, - 45, - 52, - 98, - 48, - 56, - 45, - 98, - 57, - 51, - 101, - 45, - 51, - 97, - 102, - 52, - 99, - 97, - 54, - 97, - 54, - 53, - 55, - 97 - ] - }, - { - "origin": "15210d8d-308c-4acd-843c-ba6babada62c", - "toBase64Url": "MTUyMTBkOGQtMzA4Yy00YWNkLTg0M2MtYmE2YmFiYWRhNjJj", - "fromBase64Url": [ - 49, - 53, - 50, - 49, - 48, - 100, - 56, - 100, - 45, - 51, - 48, - 56, - 99, - 45, - 52, - 97, - 99, - 100, - 45, - 56, - 52, - 51, - 99, - 45, - 98, - 97, - 54, - 98, - 97, - 98, - 97, - 100, - 97, - 54, - 50, - 99 - ] - }, - { - "origin": "cba26c96-51ad-40c0-b29f-6a46e0d88d43", - "toBase64Url": "Y2JhMjZjOTYtNTFhZC00MGMwLWIyOWYtNmE0NmUwZDg4ZDQz", - "fromBase64Url": [ - 99, - 98, - 97, - 50, - 54, - 99, - 57, - 54, - 45, - 53, - 49, - 97, - 100, - 45, - 52, - 48, - 99, - 48, - 45, - 98, - 50, - 57, - 102, - 45, - 54, - 97, - 52, - 54, - 101, - 48, - 100, - 56, - 56, - 100, - 52, - 51 - ] - }, - { - "origin": "c13cdc12-c7ed-41db-a669-56a664f8127a", - "toBase64Url": "YzEzY2RjMTItYzdlZC00MWRiLWE2NjktNTZhNjY0ZjgxMjdh", - "fromBase64Url": [ - 99, - 49, - 51, - 99, - 100, - 99, - 49, - 50, - 45, - 99, - 55, - 101, - 100, - 45, - 52, - 49, - 100, - 98, - 45, - 97, - 54, - 54, - 57, - 45, - 53, - 54, - 97, - 54, - 54, - 52, - 102, - 56, - 49, - 50, - 55, - 97 - ] - }, - { - "origin": "8507cd12-1a02-4a48-92a5-23fbbe7ad5fe", - "toBase64Url": "ODUwN2NkMTItMWEwMi00YTQ4LTkyYTUtMjNmYmJlN2FkNWZl", - "fromBase64Url": [ - 56, - 53, - 48, - 55, - 99, - 100, - 49, - 50, - 45, - 49, - 97, - 48, - 50, - 45, - 52, - 97, - 52, - 56, - 45, - 57, - 50, - 97, - 53, - 45, - 50, - 51, - 102, - 98, - 98, - 101, - 55, - 97, - 100, - 53, - 102, - 101 - ] - }, - { - "origin": "02b073e9-f33c-4f06-b3aa-d94101a06494", - "toBase64Url": "MDJiMDczZTktZjMzYy00ZjA2LWIzYWEtZDk0MTAxYTA2NDk0", - "fromBase64Url": [ - 48, - 50, - 98, - 48, - 55, - 51, - 101, - 57, - 45, - 102, - 51, - 51, - 99, - 45, - 52, - 102, - 48, - 54, - 45, - 98, - 51, - 97, - 97, - 45, - 100, - 57, - 52, - 49, - 48, - 49, - 97, - 48, - 54, - 52, - 57, - 52 - ] - }, - { - "origin": "064b6627-6dcb-439b-979d-a38c6a4e10f4", - "toBase64Url": "MDY0YjY2MjctNmRjYi00MzliLTk3OWQtYTM4YzZhNGUxMGY0", - "fromBase64Url": [ - 48, - 54, - 52, - 98, - 54, - 54, - 50, - 55, - 45, - 54, - 100, - 99, - 98, - 45, - 52, - 51, - 57, - 98, - 45, - 57, - 55, - 57, - 100, - 45, - 97, - 51, - 56, - 99, - 54, - 97, - 52, - 101, - 49, - 48, - 102, - 52 - ] - }, - { - "origin": "f32a0d44-6d3c-4f68-ba4d-0bc26aed6c7f", - "toBase64Url": "ZjMyYTBkNDQtNmQzYy00ZjY4LWJhNGQtMGJjMjZhZWQ2Yzdm", - "fromBase64Url": [ - 102, - 51, - 50, - 97, - 48, - 100, - 52, - 52, - 45, - 54, - 100, - 51, - 99, - 45, - 52, - 102, - 54, - 56, - 45, - 98, - 97, - 52, - 100, - 45, - 48, - 98, - 99, - 50, - 54, - 97, - 101, - 100, - 54, - 99, - 55, - 102 - ] - }, - { - "origin": "73b68c21-7bab-4608-ad9c-67d2fb954fa2", - "toBase64Url": "NzNiNjhjMjEtN2JhYi00NjA4LWFkOWMtNjdkMmZiOTU0ZmEy", - "fromBase64Url": [ - 55, - 51, - 98, - 54, - 56, - 99, - 50, - 49, - 45, - 55, - 98, - 97, - 98, - 45, - 52, - 54, - 48, - 56, - 45, - 97, - 100, - 57, - 99, - 45, - 54, - 55, - 100, - 50, - 102, - 98, - 57, - 53, - 52, - 102, - 97, - 50 - ] - }, - { - "origin": "d626dd1f-50c5-4438-b920-72b852bb89cd", - "toBase64Url": "ZDYyNmRkMWYtNTBjNS00NDM4LWI5MjAtNzJiODUyYmI4OWNk", - "fromBase64Url": [ - 100, - 54, - 50, - 54, - 100, - 100, - 49, - 102, - 45, - 53, - 48, - 99, - 53, - 45, - 52, - 52, - 51, - 56, - 45, - 98, - 57, - 50, - 48, - 45, - 55, - 50, - 98, - 56, - 53, - 50, - 98, - 98, - 56, - 57, - 99, - 100 - ] - }, - { - "origin": "e598d7e0-282e-4ae9-909b-b18b9710b2b4", - "toBase64Url": "ZTU5OGQ3ZTAtMjgyZS00YWU5LTkwOWItYjE4Yjk3MTBiMmI0", - "fromBase64Url": [ - 101, - 53, - 57, - 56, - 100, - 55, - 101, - 48, - 45, - 50, - 56, - 50, - 101, - 45, - 52, - 97, - 101, - 57, - 45, - 57, - 48, - 57, - 98, - 45, - 98, - 49, - 56, - 98, - 57, - 55, - 49, - 48, - 98, - 50, - 98, - 52 - ] - }, - { - "origin": "84c50a1a-38bb-470b-8347-68d9e323f3d8", - "toBase64Url": "ODRjNTBhMWEtMzhiYi00NzBiLTgzNDctNjhkOWUzMjNmM2Q4", - "fromBase64Url": [ - 56, - 52, - 99, - 53, - 48, - 97, - 49, - 97, - 45, - 51, - 56, - 98, - 98, - 45, - 52, - 55, - 48, - 98, - 45, - 56, - 51, - 52, - 55, - 45, - 54, - 56, - 100, - 57, - 101, - 51, - 50, - 51, - 102, - 51, - 100, - 56 - ] - }, - { - "origin": "53bae0ac-5462-438f-89c4-aa1204146eca", - "toBase64Url": "NTNiYWUwYWMtNTQ2Mi00MzhmLTg5YzQtYWExMjA0MTQ2ZWNh", - "fromBase64Url": [ - 53, - 51, - 98, - 97, - 101, - 48, - 97, - 99, - 45, - 53, - 52, - 54, - 50, - 45, - 52, - 51, - 56, - 102, - 45, - 56, - 57, - 99, - 52, - 45, - 97, - 97, - 49, - 50, - 48, - 52, - 49, - 52, - 54, - 101, - 99, - 97 - ] - }, - { - "origin": "4b487db9-abba-40c5-a0ad-b2250878a332", - "toBase64Url": "NGI0ODdkYjktYWJiYS00MGM1LWEwYWQtYjIyNTA4NzhhMzMy", - "fromBase64Url": [ - 52, - 98, - 52, - 56, - 55, - 100, - 98, - 57, - 45, - 97, - 98, - 98, - 97, - 45, - 52, - 48, - 99, - 53, - 45, - 97, - 48, - 97, - 100, - 45, - 98, - 50, - 50, - 53, - 48, - 56, - 55, - 56, - 97, - 51, - 51, - 50 - ] - }, - { - "origin": "d0941714-eae3-40db-a789-f21aa6401b0d", - "toBase64Url": "ZDA5NDE3MTQtZWFlMy00MGRiLWE3ODktZjIxYWE2NDAxYjBk", - "fromBase64Url": [ - 100, - 48, - 57, - 52, - 49, - 55, - 49, - 52, - 45, - 101, - 97, - 101, - 51, - 45, - 52, - 48, - 100, - 98, - 45, - 97, - 55, - 56, - 57, - 45, - 102, - 50, - 49, - 97, - 97, - 54, - 52, - 48, - 49, - 98, - 48, - 100 - ] - }, - { - "origin": "efb79528-d0bd-433e-be9f-f1020cee08fa", - "toBase64Url": "ZWZiNzk1MjgtZDBiZC00MzNlLWJlOWYtZjEwMjBjZWUwOGZh", - "fromBase64Url": [ - 101, - 102, - 98, - 55, - 57, - 53, - 50, - 56, - 45, - 100, - 48, - 98, - 100, - 45, - 52, - 51, - 51, - 101, - 45, - 98, - 101, - 57, - 102, - 45, - 102, - 49, - 48, - 50, - 48, - 99, - 101, - 101, - 48, - 56, - 102, - 97 - ] - }, - { - "origin": "da2a799b-e1fe-460a-8f3f-0a5f4a124359", - "toBase64Url": "ZGEyYTc5OWItZTFmZS00NjBhLThmM2YtMGE1ZjRhMTI0MzU5", - "fromBase64Url": [ - 100, - 97, - 50, - 97, - 55, - 57, - 57, - 98, - 45, - 101, - 49, - 102, - 101, - 45, - 52, - 54, - 48, - 97, - 45, - 56, - 102, - 51, - 102, - 45, - 48, - 97, - 53, - 102, - 52, - 97, - 49, - 50, - 52, - 51, - 53, - 57 - ] - }, - { - "origin": "822dc1c2-556c-4cee-8c37-411ac530a088", - "toBase64Url": "ODIyZGMxYzItNTU2Yy00Y2VlLThjMzctNDExYWM1MzBhMDg4", - "fromBase64Url": [ - 56, - 50, - 50, - 100, - 99, - 49, - 99, - 50, - 45, - 53, - 53, - 54, - 99, - 45, - 52, - 99, - 101, - 101, - 45, - 56, - 99, - 51, - 55, - 45, - 52, - 49, - 49, - 97, - 99, - 53, - 51, - 48, - 97, - 48, - 56, - 56 - ] - }, - { - "origin": "d035ec77-dd78-4a51-8392-ad28870b0905", - "toBase64Url": "ZDAzNWVjNzctZGQ3OC00YTUxLTgzOTItYWQyODg3MGIwOTA1", - "fromBase64Url": [ - 100, - 48, - 51, - 53, - 101, - 99, - 55, - 55, - 45, - 100, - 100, - 55, - 56, - 45, - 52, - 97, - 53, - 49, - 45, - 56, - 51, - 57, - 50, - 45, - 97, - 100, - 50, - 56, - 56, - 55, - 48, - 98, - 48, - 57, - 48, - 53 - ] - }, - { - "origin": "c934cf59-56a9-45f6-bdbd-7273d2ae86c8", - "toBase64Url": "YzkzNGNmNTktNTZhOS00NWY2LWJkYmQtNzI3M2QyYWU4NmM4", - "fromBase64Url": [ - 99, - 57, - 51, - 52, - 99, - 102, - 53, - 57, - 45, - 53, - 54, - 97, - 57, - 45, - 52, - 53, - 102, - 54, - 45, - 98, - 100, - 98, - 100, - 45, - 55, - 50, - 55, - 51, - 100, - 50, - 97, - 101, - 56, - 54, - 99, - 56 - ] - }, - { - "origin": "b2c572bb-98e1-4d6b-b06c-865a749aacf6", - "toBase64Url": "YjJjNTcyYmItOThlMS00ZDZiLWIwNmMtODY1YTc0OWFhY2Y2", - "fromBase64Url": [ - 98, - 50, - 99, - 53, - 55, - 50, - 98, - 98, - 45, - 57, - 56, - 101, - 49, - 45, - 52, - 100, - 54, - 98, - 45, - 98, - 48, - 54, - 99, - 45, - 56, - 54, - 53, - 97, - 55, - 52, - 57, - 97, - 97, - 99, - 102, - 54 - ] - }, - { - "origin": "5f571217-335c-422e-8c76-0e8b4e1296cf", - "toBase64Url": "NWY1NzEyMTctMzM1Yy00MjJlLThjNzYtMGU4YjRlMTI5NmNm", - "fromBase64Url": [ - 53, - 102, - 53, - 55, - 49, - 50, - 49, - 55, - 45, - 51, - 51, - 53, - 99, - 45, - 52, - 50, - 50, - 101, - 45, - 56, - 99, - 55, - 54, - 45, - 48, - 101, - 56, - 98, - 52, - 101, - 49, - 50, - 57, - 54, - 99, - 102 - ] - } -] \ No newline at end of file diff --git a/clients/liquid-auth-core/tests/__fixtures__/wallet.keys.fixtures.json b/clients/liquid-auth-core/tests/__fixtures__/wallet.keys.fixtures.json deleted file mode 100644 index a3d3614..0000000 --- a/clients/liquid-auth-core/tests/__fixtures__/wallet.keys.fixtures.json +++ /dev/null @@ -1,2972 +0,0 @@ -[ - { - "encoded": "65X3KSKFCNX3VUPQDVO3RQUHDZN7BONGBEC6PJWAVKX73DIC356M7M32JM", - "checksum": [ - 207, - 179, - 122, - 75 - ], - "publicKey": [ - 247, - 111, - 181, - 73, - 69, - 19, - 111, - 186, - 209, - 240, - 29, - 93, - 184, - 194, - 135, - 30, - 91, - 240, - 185, - 166, - 9, - 5, - 231, - 166, - 192, - 170, - 175, - 253, - 141, - 2, - 223, - 124 - ], - "privateKey": [ - 236, - 82, - 165, - 230, - 144, - 235, - 251, - 237, - 230, - 241, - 97, - 239, - 230, - 114, - 115, - 205, - 39, - 237, - 91, - 91, - 228, - 34, - 157, - 91, - 55, - 84, - 65, - 60, - 26, - 48, - 169, - 8, - 247, - 111, - 181, - 73, - 69, - 19, - 111, - 186, - 209, - 240, - 29, - 93, - 184, - 194, - 135, - 30, - 91, - 240, - 185, - 166, - 9, - 5, - 231, - 166, - 192, - 170, - 175, - 253, - 141, - 2, - 223, - 124 - ], - "valid": true - }, - { - "encoded": "3DZKAZ2YN5JN5QBGWM75W23O64OTW4MPPQQDDS5AILP3QYMFPKKIEUDTAM", - "checksum": [ - 130, - 80, - 115, - 3 - ], - "publicKey": [ - 216, - 242, - 160, - 103, - 88, - 111, - 82, - 222, - 192, - 38, - 179, - 63, - 219, - 107, - 110, - 247, - 29, - 59, - 113, - 143, - 124, - 32, - 49, - 203, - 160, - 66, - 223, - 184, - 97, - 133, - 122, - 148 - ], - "privateKey": [ - 152, - 114, - 225, - 108, - 240, - 100, - 213, - 212, - 172, - 48, - 32, - 144, - 151, - 231, - 32, - 30, - 173, - 153, - 195, - 20, - 174, - 169, - 232, - 82, - 236, - 159, - 30, - 96, - 252, - 142, - 39, - 13, - 216, - 242, - 160, - 103, - 88, - 111, - 82, - 222, - 192, - 38, - 179, - 63, - 219, - 107, - 110, - 247, - 29, - 59, - 113, - 143, - 124, - 32, - 49, - 203, - 160, - 66, - 223, - 184, - 97, - 133, - 122, - 148 - ], - "valid": true - }, - { - "encoded": "3CA3UDJ7AAWQ7XEBL7LKYBN4IQ4IRJMN3BO2DTAE7LPWMN4UFCFI6ZLXYQ", - "checksum": [ - 143, - 101, - 119, - 196 - ], - "publicKey": [ - 216, - 129, - 186, - 13, - 63, - 0, - 45, - 15, - 220, - 129, - 95, - 214, - 172, - 5, - 188, - 68, - 56, - 136, - 165, - 141, - 216, - 93, - 161, - 204, - 4, - 250, - 223, - 102, - 55, - 148, - 40, - 138 - ], - "privateKey": [ - 60, - 205, - 4, - 66, - 151, - 5, - 167, - 248, - 113, - 97, - 104, - 157, - 84, - 50, - 89, - 30, - 144, - 185, - 44, - 229, - 202, - 201, - 156, - 195, - 39, - 47, - 19, - 233, - 108, - 69, - 129, - 218, - 216, - 129, - 186, - 13, - 63, - 0, - 45, - 15, - 220, - 129, - 95, - 214, - 172, - 5, - 188, - 68, - 56, - 136, - 165, - 141, - 216, - 93, - 161, - 204, - 4, - 250, - 223, - 102, - 55, - 148, - 40, - 138 - ], - "valid": true - }, - { - "encoded": "IFJIXXNSNTAUCDML4QVJ6T3VXSPBRDJCNX2YLZFPRO7I7GTTW5OSXTUSFU", - "checksum": [ - 43, - 206, - 146, - 45 - ], - "publicKey": [ - 65, - 82, - 139, - 221, - 178, - 108, - 193, - 65, - 13, - 139, - 228, - 42, - 159, - 79, - 117, - 188, - 158, - 24, - 141, - 34, - 109, - 245, - 133, - 228, - 175, - 139, - 190, - 143, - 154, - 115, - 183, - 93 - ], - "privateKey": [ - 47, - 32, - 137, - 143, - 141, - 169, - 18, - 201, - 164, - 162, - 151, - 241, - 159, - 238, - 30, - 215, - 92, - 41, - 79, - 3, - 253, - 206, - 123, - 30, - 160, - 207, - 39, - 194, - 23, - 77, - 25, - 87, - 65, - 82, - 139, - 221, - 178, - 108, - 193, - 65, - 13, - 139, - 228, - 42, - 159, - 79, - 117, - 188, - 158, - 24, - 141, - 34, - 109, - 245, - 133, - 228, - 175, - 139, - 190, - 143, - 154, - 115, - 183, - 93 - ], - "valid": true - }, - { - "encoded": "DEVJC5CGWY5HW4MWAR7B2LJ27UGN6FIBDZSZHOXPYFBEOQ4CAKHOIGBAFU", - "checksum": [ - 228, - 24, - 32, - 45 - ], - "publicKey": [ - 25, - 42, - 145, - 116, - 70, - 182, - 58, - 123, - 113, - 150, - 4, - 126, - 29, - 45, - 58, - 253, - 12, - 223, - 21, - 1, - 30, - 101, - 147, - 186, - 239, - 193, - 66, - 71, - 67, - 130, - 2, - 142 - ], - "privateKey": [ - 59, - 135, - 230, - 131, - 153, - 70, - 197, - 206, - 114, - 168, - 168, - 48, - 224, - 98, - 88, - 6, - 152, - 206, - 54, - 215, - 145, - 201, - 19, - 105, - 141, - 2, - 12, - 119, - 104, - 49, - 67, - 173, - 25, - 42, - 145, - 116, - 70, - 182, - 58, - 123, - 113, - 150, - 4, - 126, - 29, - 45, - 58, - 253, - 12, - 223, - 21, - 1, - 30, - 101, - 147, - 186, - 239, - 193, - 66, - 71, - 67, - 130, - 2, - 142 - ], - "valid": true - }, - { - "encoded": "7F55SDXF6MAB4CPZDRJEJOPLAXUVC2K4UKCOFE2XZBUWM3PUZHHDAPBB6Y", - "checksum": [ - 48, - 60, - 33, - 246 - ], - "publicKey": [ - 249, - 123, - 217, - 14, - 229, - 243, - 0, - 30, - 9, - 249, - 28, - 82, - 68, - 185, - 235, - 5, - 233, - 81, - 105, - 92, - 162, - 132, - 226, - 147, - 87, - 200, - 105, - 102, - 109, - 244, - 201, - 206 - ], - "privateKey": [ - 170, - 229, - 17, - 238, - 54, - 123, - 122, - 60, - 139, - 221, - 182, - 156, - 180, - 215, - 174, - 87, - 99, - 138, - 60, - 38, - 232, - 75, - 134, - 182, - 181, - 152, - 248, - 252, - 182, - 132, - 218, - 142, - 249, - 123, - 217, - 14, - 229, - 243, - 0, - 30, - 9, - 249, - 28, - 82, - 68, - 185, - 235, - 5, - 233, - 81, - 105, - 92, - 162, - 132, - 226, - 147, - 87, - 200, - 105, - 102, - 109, - 244, - 201, - 206 - ], - "valid": true - }, - { - "encoded": "YZILV5REF7QEWU4AXWB47IPPV6NZIX3GLI5OW77DY7COHNA2Q6ZOZJEEIA", - "checksum": [ - 236, - 164, - 132, - 64 - ], - "publicKey": [ - 198, - 80, - 186, - 246, - 36, - 47, - 224, - 75, - 83, - 128, - 189, - 131, - 207, - 161, - 239, - 175, - 155, - 148, - 95, - 102, - 90, - 58, - 235, - 127, - 227, - 199, - 196, - 227, - 180, - 26, - 135, - 178 - ], - "privateKey": [ - 200, - 107, - 43, - 245, - 88, - 254, - 51, - 104, - 17, - 85, - 250, - 110, - 170, - 119, - 20, - 131, - 124, - 31, - 32, - 95, - 201, - 69, - 210, - 175, - 142, - 53, - 183, - 156, - 82, - 146, - 148, - 71, - 198, - 80, - 186, - 246, - 36, - 47, - 224, - 75, - 83, - 128, - 189, - 131, - 207, - 161, - 239, - 175, - 155, - 148, - 95, - 102, - 90, - 58, - 235, - 127, - 227, - 199, - 196, - 227, - 180, - 26, - 135, - 178 - ], - "valid": true - }, - { - "encoded": "7KQHLEGZYRASKPLX56Y2HX7IXHFKA7HQ73SNUHOGJJVAR7HG4FGN5KPJOY", - "checksum": [ - 222, - 169, - 233, - 118 - ], - "publicKey": [ - 250, - 160, - 117, - 144, - 217, - 196, - 65, - 37, - 61, - 119, - 239, - 177, - 163, - 223, - 232, - 185, - 202, - 160, - 124, - 240, - 254, - 228, - 218, - 29, - 198, - 74, - 106, - 8, - 252, - 230, - 225, - 76 - ], - "privateKey": [ - 149, - 127, - 178, - 220, - 65, - 150, - 96, - 238, - 72, - 215, - 215, - 107, - 116, - 136, - 188, - 151, - 101, - 82, - 161, - 17, - 189, - 41, - 17, - 232, - 22, - 57, - 183, - 130, - 167, - 68, - 79, - 49, - 250, - 160, - 117, - 144, - 217, - 196, - 65, - 37, - 61, - 119, - 239, - 177, - 163, - 223, - 232, - 185, - 202, - 160, - 124, - 240, - 254, - 228, - 218, - 29, - 198, - 74, - 106, - 8, - 252, - 230, - 225, - 76 - ], - "valid": true - }, - { - "encoded": "LIC5K5IW6K2GE5Q5GA3E6OZA7FQUCI4XR5A3GE3SLOF6U3LXAT2J7RIRKE", - "checksum": [ - 159, - 197, - 17, - 81 - ], - "publicKey": [ - 90, - 5, - 213, - 117, - 22, - 242, - 180, - 98, - 118, - 29, - 48, - 54, - 79, - 59, - 32, - 249, - 97, - 65, - 35, - 151, - 143, - 65, - 179, - 19, - 114, - 91, - 139, - 234, - 109, - 119, - 4, - 244 - ], - "privateKey": [ - 255, - 188, - 242, - 10, - 174, - 222, - 130, - 43, - 72, - 183, - 35, - 151, - 13, - 4, - 71, - 139, - 206, - 175, - 235, - 38, - 37, - 247, - 101, - 193, - 96, - 125, - 1, - 207, - 69, - 48, - 47, - 158, - 90, - 5, - 213, - 117, - 22, - 242, - 180, - 98, - 118, - 29, - 48, - 54, - 79, - 59, - 32, - 249, - 97, - 65, - 35, - 151, - 143, - 65, - 179, - 19, - 114, - 91, - 139, - 234, - 109, - 119, - 4, - 244 - ], - "valid": true - }, - { - "encoded": "ABRYPE4VTV7Y25NJPYA3ENHUCIZHD4AD3L57QFM6GMUFSPPH5NZNLINR2U", - "checksum": [ - 213, - 161, - 177, - 213 - ], - "publicKey": [ - 0, - 99, - 135, - 147, - 149, - 157, - 127, - 141, - 117, - 169, - 126, - 1, - 178, - 52, - 244, - 18, - 50, - 113, - 240, - 3, - 218, - 251, - 248, - 21, - 158, - 51, - 40, - 89, - 61, - 231, - 235, - 114 - ], - "privateKey": [ - 26, - 185, - 149, - 114, - 143, - 48, - 38, - 79, - 77, - 45, - 9, - 217, - 48, - 239, - 132, - 182, - 220, - 33, - 72, - 101, - 28, - 194, - 32, - 9, - 211, - 57, - 219, - 51, - 225, - 157, - 235, - 68, - 0, - 99, - 135, - 147, - 149, - 157, - 127, - 141, - 117, - 169, - 126, - 1, - 178, - 52, - 244, - 18, - 50, - 113, - 240, - 3, - 218, - 251, - 248, - 21, - 158, - 51, - 40, - 89, - 61, - 231, - 235, - 114 - ], - "valid": true - }, - { - "encoded": "TLRWCVZN22GRXQQEDWCMP64UD63DDKX5RU2KLG2SROOSHMRCW2TYBX6IPA", - "checksum": [ - 128, - 223, - 200, - 120 - ], - "publicKey": [ - 154, - 227, - 97, - 87, - 45, - 214, - 141, - 27, - 194, - 4, - 29, - 132, - 199, - 251, - 148, - 31, - 182, - 49, - 170, - 253, - 141, - 52, - 165, - 155, - 82, - 139, - 157, - 35, - 178, - 34, - 182, - 167 - ], - "privateKey": [ - 142, - 247, - 46, - 26, - 245, - 91, - 2, - 250, - 59, - 32, - 77, - 184, - 143, - 20, - 252, - 20, - 230, - 81, - 31, - 99, - 78, - 174, - 62, - 132, - 203, - 79, - 112, - 39, - 10, - 243, - 45, - 58, - 154, - 227, - 97, - 87, - 45, - 214, - 141, - 27, - 194, - 4, - 29, - 132, - 199, - 251, - 148, - 31, - 182, - 49, - 170, - 253, - 141, - 52, - 165, - 155, - 82, - 139, - 157, - 35, - 178, - 34, - 182, - 167 - ], - "valid": true - }, - { - "encoded": "RPM3AIUUYIZHZ53MTWQV57SIEMCWLLAWBZU5V2PGGCAD4LNAGYAKPTLK7M", - "checksum": [ - 167, - 205, - 106, - 251 - ], - "publicKey": [ - 139, - 217, - 176, - 34, - 148, - 194, - 50, - 124, - 247, - 108, - 157, - 161, - 94, - 254, - 72, - 35, - 5, - 101, - 172, - 22, - 14, - 105, - 218, - 233, - 230, - 48, - 128, - 62, - 45, - 160, - 54, - 0 - ], - "privateKey": [ - 83, - 91, - 204, - 156, - 166, - 183, - 152, - 183, - 89, - 116, - 168, - 194, - 158, - 207, - 200, - 225, - 5, - 217, - 96, - 232, - 204, - 119, - 171, - 68, - 149, - 88, - 0, - 69, - 226, - 124, - 156, - 40, - 139, - 217, - 176, - 34, - 148, - 194, - 50, - 124, - 247, - 108, - 157, - 161, - 94, - 254, - 72, - 35, - 5, - 101, - 172, - 22, - 14, - 105, - 218, - 233, - 230, - 48, - 128, - 62, - 45, - 160, - 54, - 0 - ], - "valid": true - }, - { - "encoded": "Y5BMK2M4RCTM4P4NI4KITKG6RDVIAFTHAWZOFQRZ3DY6LQANC47G67AQDA", - "checksum": [ - 111, - 124, - 16, - 24 - ], - "publicKey": [ - 199, - 66, - 197, - 105, - 156, - 136, - 166, - 206, - 63, - 141, - 71, - 20, - 137, - 168, - 222, - 136, - 234, - 128, - 22, - 103, - 5, - 178, - 226, - 194, - 57, - 216, - 241, - 229, - 192, - 13, - 23, - 62 - ], - "privateKey": [ - 231, - 105, - 81, - 0, - 19, - 201, - 132, - 39, - 165, - 197, - 52, - 54, - 182, - 11, - 163, - 210, - 58, - 56, - 146, - 198, - 100, - 44, - 94, - 5, - 152, - 250, - 79, - 193, - 233, - 34, - 104, - 157, - 199, - 66, - 197, - 105, - 156, - 136, - 166, - 206, - 63, - 141, - 71, - 20, - 137, - 168, - 222, - 136, - 234, - 128, - 22, - 103, - 5, - 178, - 226, - 194, - 57, - 216, - 241, - 229, - 192, - 13, - 23, - 62 - ], - "valid": true - }, - { - "encoded": "UM4F2PWJDTUT6JGMC6EHTEQH3ZYDSWIITY7LJX5WKWSMGLS3BOEREE64AI", - "checksum": [ - 18, - 19, - 220, - 2 - ], - "publicKey": [ - 163, - 56, - 93, - 62, - 201, - 28, - 233, - 63, - 36, - 204, - 23, - 136, - 121, - 146, - 7, - 222, - 112, - 57, - 89, - 8, - 158, - 62, - 180, - 223, - 182, - 85, - 164, - 195, - 46, - 91, - 11, - 137 - ], - "privateKey": [ - 248, - 82, - 21, - 209, - 157, - 247, - 81, - 107, - 89, - 168, - 80, - 67, - 122, - 44, - 171, - 169, - 41, - 181, - 9, - 192, - 166, - 134, - 137, - 128, - 149, - 201, - 214, - 31, - 117, - 193, - 190, - 80, - 163, - 56, - 93, - 62, - 201, - 28, - 233, - 63, - 36, - 204, - 23, - 136, - 121, - 146, - 7, - 222, - 112, - 57, - 89, - 8, - 158, - 62, - 180, - 223, - 182, - 85, - 164, - 195, - 46, - 91, - 11, - 137 - ], - "valid": true - }, - { - "encoded": "Z4EZILHIAVL22WSXYQ4YNOXDVZAYJCXOROQ3RV2ZPFORWXITDIGJYPT7AE", - "checksum": [ - 156, - 62, - 127, - 1 - ], - "publicKey": [ - 207, - 9, - 148, - 44, - 232, - 5, - 87, - 173, - 90, - 87, - 196, - 57, - 134, - 186, - 227, - 174, - 65, - 132, - 138, - 238, - 139, - 161, - 184, - 215, - 89, - 121, - 93, - 27, - 93, - 19, - 26, - 12 - ], - "privateKey": [ - 78, - 155, - 21, - 250, - 204, - 122, - 133, - 236, - 164, - 137, - 234, - 124, - 161, - 0, - 99, - 3, - 89, - 135, - 152, - 128, - 153, - 85, - 240, - 227, - 187, - 140, - 181, - 128, - 145, - 122, - 22, - 76, - 207, - 9, - 148, - 44, - 232, - 5, - 87, - 173, - 90, - 87, - 196, - 57, - 134, - 186, - 227, - 174, - 65, - 132, - 138, - 238, - 139, - 161, - 184, - 215, - 89, - 121, - 93, - 27, - 93, - 19, - 26, - 12 - ], - "valid": true - }, - { - "encoded": "W67VZ3BUOIHYKQTRQMRST3D3DH3GZQ43SLDPUN2UUQRQG7QV24BXZORLZ4", - "checksum": [ - 124, - 186, - 43, - 207 - ], - "publicKey": [ - 183, - 191, - 92, - 236, - 52, - 114, - 15, - 133, - 66, - 113, - 131, - 35, - 41, - 236, - 123, - 25, - 246, - 108, - 195, - 155, - 146, - 198, - 250, - 55, - 84, - 164, - 35, - 3, - 126, - 21, - 215, - 3 - ], - "privateKey": [ - 197, - 54, - 178, - 164, - 214, - 232, - 186, - 145, - 212, - 210, - 240, - 179, - 30, - 138, - 155, - 165, - 11, - 180, - 13, - 241, - 10, - 181, - 210, - 72, - 125, - 124, - 199, - 142, - 49, - 219, - 155, - 163, - 183, - 191, - 92, - 236, - 52, - 114, - 15, - 133, - 66, - 113, - 131, - 35, - 41, - 236, - 123, - 25, - 246, - 108, - 195, - 155, - 146, - 198, - 250, - 55, - 84, - 164, - 35, - 3, - 126, - 21, - 215, - 3 - ], - "valid": true - }, - { - "encoded": "5QZA22GPL44PLHHE5VQLMI7N6GTHCJIUARS4VMLF5UTV5WCWAH5N2C7IYQ", - "checksum": [ - 221, - 11, - 232, - 196 - ], - "publicKey": [ - 236, - 50, - 13, - 104, - 207, - 95, - 56, - 245, - 156, - 228, - 237, - 96, - 182, - 35, - 237, - 241, - 166, - 113, - 37, - 20, - 4, - 101, - 202, - 177, - 101, - 237, - 39, - 94, - 216, - 86, - 1, - 250 - ], - "privateKey": [ - 215, - 168, - 230, - 6, - 122, - 132, - 10, - 131, - 105, - 210, - 33, - 72, - 199, - 63, - 234, - 0, - 154, - 126, - 34, - 243, - 70, - 241, - 217, - 197, - 237, - 62, - 218, - 56, - 111, - 209, - 77, - 249, - 236, - 50, - 13, - 104, - 207, - 95, - 56, - 245, - 156, - 228, - 237, - 96, - 182, - 35, - 237, - 241, - 166, - 113, - 37, - 20, - 4, - 101, - 202, - 177, - 101, - 237, - 39, - 94, - 216, - 86, - 1, - 250 - ], - "valid": true - }, - { - "encoded": "ZA44DPMGYEPONVXWHUTBQ66SKCB5PX7BPWHIMFKAOEV5MRBJKL7ADHXGQY", - "checksum": [ - 1, - 158, - 230, - 134 - ], - "publicKey": [ - 200, - 57, - 193, - 189, - 134, - 193, - 30, - 230, - 214, - 246, - 61, - 38, - 24, - 123, - 210, - 80, - 131, - 215, - 223, - 225, - 125, - 142, - 134, - 21, - 64, - 113, - 43, - 214, - 68, - 41, - 82, - 254 - ], - "privateKey": [ - 243, - 190, - 156, - 61, - 249, - 117, - 242, - 42, - 26, - 52, - 88, - 164, - 80, - 66, - 196, - 99, - 223, - 96, - 56, - 108, - 69, - 43, - 210, - 52, - 235, - 177, - 145, - 183, - 130, - 32, - 133, - 104, - 200, - 57, - 193, - 189, - 134, - 193, - 30, - 230, - 214, - 246, - 61, - 38, - 24, - 123, - 210, - 80, - 131, - 215, - 223, - 225, - 125, - 142, - 134, - 21, - 64, - 113, - 43, - 214, - 68, - 41, - 82, - 254 - ], - "valid": true - }, - { - "encoded": "MQ3AVNCM7P7BD7NHDD3HFEMJKTAZUTHI7FVLZTV2UJBW4TDBYCANNXF2PU", - "checksum": [ - 214, - 220, - 186, - 125 - ], - "publicKey": [ - 100, - 54, - 10, - 180, - 76, - 251, - 254, - 17, - 253, - 167, - 24, - 246, - 114, - 145, - 137, - 84, - 193, - 154, - 76, - 232, - 249, - 106, - 188, - 206, - 186, - 162, - 67, - 110, - 76, - 97, - 192, - 128 - ], - "privateKey": [ - 70, - 121, - 167, - 29, - 7, - 192, - 110, - 199, - 56, - 217, - 37, - 76, - 62, - 142, - 87, - 172, - 204, - 86, - 250, - 151, - 149, - 166, - 125, - 44, - 67, - 86, - 190, - 106, - 52, - 67, - 74, - 76, - 100, - 54, - 10, - 180, - 76, - 251, - 254, - 17, - 253, - 167, - 24, - 246, - 114, - 145, - 137, - 84, - 193, - 154, - 76, - 232, - 249, - 106, - 188, - 206, - 186, - 162, - 67, - 110, - 76, - 97, - 192, - 128 - ], - "valid": true - }, - { - "encoded": "RHY76D66VAWH7CAS3TCDN4TVUKRFT6SRIBAHSIQLX65BT6ZUXHEOXFM4IU", - "checksum": [ - 235, - 149, - 156, - 69 - ], - "publicKey": [ - 137, - 241, - 255, - 15, - 222, - 168, - 44, - 127, - 136, - 18, - 220, - 196, - 54, - 242, - 117, - 162, - 162, - 89, - 250, - 81, - 64, - 64, - 121, - 34, - 11, - 191, - 186, - 25, - 251, - 52, - 185, - 200 - ], - "privateKey": [ - 121, - 22, - 228, - 11, - 197, - 95, - 122, - 61, - 187, - 147, - 228, - 14, - 156, - 6, - 128, - 96, - 111, - 111, - 242, - 234, - 197, - 159, - 147, - 121, - 109, - 154, - 155, - 40, - 78, - 35, - 74, - 226, - 137, - 241, - 255, - 15, - 222, - 168, - 44, - 127, - 136, - 18, - 220, - 196, - 54, - 242, - 117, - 162, - 162, - 89, - 250, - 81, - 64, - 64, - 121, - 34, - 11, - 191, - 186, - 25, - 251, - 52, - 185, - 200 - ], - "valid": true - }, - { - "encoded": "KDHPRHISHU25PJO5OG36NS5MMPPRMLITDWRHZKSKYVMH4YUCAGRYTHDYCY", - "checksum": [ - 137, - 156, - 120, - 22 - ], - "publicKey": [ - 80, - 206, - 248, - 157, - 18, - 61, - 53, - 215, - 165, - 221, - 113, - 183, - 230, - 203, - 172, - 99, - 223, - 22, - 45, - 19, - 29, - 162, - 124, - 170, - 74, - 197, - 88, - 126, - 98, - 130, - 1, - 163 - ], - "privateKey": [ - 194, - 133, - 62, - 0, - 75, - 220, - 24, - 137, - 21, - 68, - 233, - 242, - 236, - 145, - 44, - 49, - 218, - 158, - 249, - 177, - 236, - 11, - 85, - 94, - 224, - 98, - 236, - 28, - 172, - 204, - 26, - 140, - 80, - 206, - 248, - 157, - 18, - 61, - 53, - 215, - 165, - 221, - 113, - 183, - 230, - 203, - 172, - 99, - 223, - 22, - 45, - 19, - 29, - 162, - 124, - 170, - 74, - 197, - 88, - 126, - 98, - 130, - 1, - 163 - ], - "valid": true - }, - { - "encoded": "RXVJINFGGMBCNU7NOFKTAOFIFJ5R3A4EWHKAWCW6KNXTRDQCFCRGV3BF4M", - "checksum": [ - 106, - 236, - 37, - 227 - ], - "publicKey": [ - 141, - 234, - 148, - 52, - 166, - 51, - 2, - 38, - 211, - 237, - 113, - 85, - 48, - 56, - 168, - 42, - 123, - 29, - 131, - 132, - 177, - 212, - 11, - 10, - 222, - 83, - 111, - 56, - 142, - 2, - 40, - 162 - ], - "privateKey": [ - 174, - 110, - 127, - 107, - 13, - 238, - 168, - 163, - 107, - 207, - 64, - 140, - 144, - 65, - 3, - 179, - 50, - 248, - 133, - 145, - 228, - 201, - 13, - 149, - 94, - 80, - 9, - 24, - 89, - 183, - 48, - 177, - 141, - 234, - 148, - 52, - 166, - 51, - 2, - 38, - 211, - 237, - 113, - 85, - 48, - 56, - 168, - 42, - 123, - 29, - 131, - 132, - 177, - 212, - 11, - 10, - 222, - 83, - 111, - 56, - 142, - 2, - 40, - 162 - ], - "valid": true - }, - { - "encoded": "GSBE3TORJTLULQ5TLJWYUN4TGL2ZPDWDIJPSNZJD5UZRCUBWAKDF53OUC4", - "checksum": [ - 94, - 237, - 212, - 23 - ], - "publicKey": [ - 52, - 130, - 77, - 205, - 209, - 76, - 215, - 69, - 195, - 179, - 90, - 109, - 138, - 55, - 147, - 50, - 245, - 151, - 142, - 195, - 66, - 95, - 38, - 229, - 35, - 237, - 51, - 17, - 80, - 54, - 2, - 134 - ], - "privateKey": [ - 252, - 63, - 28, - 247, - 87, - 146, - 55, - 131, - 127, - 151, - 3, - 238, - 74, - 46, - 69, - 50, - 102, - 89, - 155, - 217, - 159, - 41, - 186, - 73, - 137, - 198, - 147, - 32, - 37, - 208, - 185, - 152, - 52, - 130, - 77, - 205, - 209, - 76, - 215, - 69, - 195, - 179, - 90, - 109, - 138, - 55, - 147, - 50, - 245, - 151, - 142, - 195, - 66, - 95, - 38, - 229, - 35, - 237, - 51, - 17, - 80, - 54, - 2, - 134 - ], - "valid": true - }, - { - "encoded": "D2L64V5Z66TLNWU5ZM54A336MTMS5AZKR5OPSMBLR4XD7VBYKETNCSAY64", - "checksum": [ - 209, - 72, - 24, - 247 - ], - "publicKey": [ - 30, - 151, - 238, - 87, - 185, - 247, - 166, - 182, - 218, - 157, - 203, - 59, - 192, - 111, - 126, - 100, - 217, - 46, - 131, - 42, - 143, - 92, - 249, - 48, - 43, - 143, - 46, - 63, - 212, - 56, - 81, - 38 - ], - "privateKey": [ - 34, - 81, - 159, - 199, - 84, - 137, - 16, - 242, - 193, - 192, - 215, - 222, - 202, - 69, - 41, - 115, - 205, - 0, - 162, - 254, - 53, - 75, - 16, - 141, - 76, - 23, - 120, - 227, - 103, - 13, - 222, - 254, - 30, - 151, - 238, - 87, - 185, - 247, - 166, - 182, - 218, - 157, - 203, - 59, - 192, - 111, - 126, - 100, - 217, - 46, - 131, - 42, - 143, - 92, - 249, - 48, - 43, - 143, - 46, - 63, - 212, - 56, - 81, - 38 - ], - "valid": true - }, - { - "encoded": "4YC7UGVCQTXTN6O4JU6NRR6II47JSMMBQFB5KQLAQOJQPPWMZBWPEYMEGU", - "checksum": [ - 242, - 97, - 132, - 53 - ], - "publicKey": [ - 230, - 5, - 250, - 26, - 162, - 132, - 239, - 54, - 249, - 220, - 77, - 60, - 216, - 199, - 200, - 71, - 62, - 153, - 49, - 129, - 129, - 67, - 213, - 65, - 96, - 131, - 147, - 7, - 190, - 204, - 200, - 108 - ], - "privateKey": [ - 235, - 119, - 55, - 43, - 251, - 155, - 99, - 84, - 236, - 172, - 40, - 207, - 137, - 142, - 14, - 1, - 219, - 100, - 11, - 11, - 173, - 130, - 192, - 235, - 137, - 60, - 202, - 202, - 98, - 211, - 15, - 223, - 230, - 5, - 250, - 26, - 162, - 132, - 239, - 54, - 249, - 220, - 77, - 60, - 216, - 199, - 200, - 71, - 62, - 153, - 49, - 129, - 129, - 67, - 213, - 65, - 96, - 131, - 147, - 7, - 190, - 204, - 200, - 108 - ], - "valid": true - }, - { - "encoded": "4ZRBSTR35CQI4HYQPF3TNTRD4UMC2JBU5HOOMXYKQT6XK73VZ7T4D727QI", - "checksum": [ - 193, - 255, - 95, - 130 - ], - "publicKey": [ - 230, - 98, - 25, - 78, - 59, - 232, - 160, - 142, - 31, - 16, - 121, - 119, - 54, - 206, - 35, - 229, - 24, - 45, - 36, - 52, - 233, - 220, - 230, - 95, - 10, - 132, - 253, - 117, - 127, - 117, - 207, - 231 - ], - "privateKey": [ - 99, - 201, - 58, - 96, - 244, - 72, - 243, - 128, - 178, - 220, - 187, - 212, - 171, - 203, - 31, - 200, - 165, - 250, - 188, - 110, - 159, - 111, - 54, - 31, - 78, - 111, - 233, - 41, - 210, - 215, - 230, - 237, - 230, - 98, - 25, - 78, - 59, - 232, - 160, - 142, - 31, - 16, - 121, - 119, - 54, - 206, - 35, - 229, - 24, - 45, - 36, - 52, - 233, - 220, - 230, - 95, - 10, - 132, - 253, - 117, - 127, - 117, - 207, - 231 - ], - "valid": true - }, - { - "encoded": "CDJO6P5IBFG2QXOPK7MAWNC5FDITMKYSE2T7RC5WERIBT2JRLINNGJBIBE", - "checksum": [ - 211, - 36, - 40, - 9 - ], - "publicKey": [ - 16, - 210, - 239, - 63, - 168, - 9, - 77, - 168, - 93, - 207, - 87, - 216, - 11, - 52, - 93, - 40, - 209, - 54, - 43, - 18, - 38, - 167, - 248, - 139, - 182, - 36, - 80, - 25, - 233, - 49, - 90, - 26 - ], - "privateKey": [ - 34, - 196, - 2, - 58, - 182, - 159, - 66, - 30, - 196, - 172, - 242, - 106, - 199, - 35, - 215, - 3, - 234, - 190, - 151, - 60, - 238, - 168, - 33, - 126, - 80, - 71, - 85, - 240, - 172, - 240, - 175, - 238, - 16, - 210, - 239, - 63, - 168, - 9, - 77, - 168, - 93, - 207, - 87, - 216, - 11, - 52, - 93, - 40, - 209, - 54, - 43, - 18, - 38, - 167, - 248, - 139, - 182, - 36, - 80, - 25, - 233, - 49, - 90, - 26 - ], - "valid": true - } -] \ No newline at end of file diff --git a/clients/liquid-auth-core/tests/encoding.spec.js b/clients/liquid-auth-core/tests/encoding.spec.js deleted file mode 100644 index 7115f46..0000000 --- a/clients/liquid-auth-core/tests/encoding.spec.js +++ /dev/null @@ -1,46 +0,0 @@ -import test from 'node:test'; -import assert from 'node:assert'; - -import * as encoding from '../lib/encoding.js'; -import base64UrlFixtures from './__fixtures__/encoding.base64url.fixtures.json' assert {type: 'json'}; -import walletKeysFixtures from './__fixtures__/wallet.keys.fixtures.json' assert {type: 'json'}; - - -// Invalid Inputs -test(`fromBase64URL(*) throws ${encoding.INVALID_BASE64URL_INPUT}`, function(){ - assert.throws(()=>encoding.fromBase64Url(12345), new Error(encoding.INVALID_BASE64URL_INPUT)); -}) -base64UrlFixtures.forEach((fixture, i)=>{ - const encoder = new TextEncoder(); - - test(`toBase64URL(${fixture.origin})`, () => { - assert.equal(fixture.toBase64Url, encoding.toBase64URL(i % 2 ? encoder.encode(fixture.origin) : fixture.fromBase64Url)); - }) - test(`fromBase64URL(${fixture.origin})`, () => { - assert.deepEqual(new Uint8Array(fixture.fromBase64Url), encoding.fromBase64Url(fixture.toBase64Url)); - }); -}) - - - - -// Test Basic Inputs -test(`decodeAddress(*) throws ${encoding.MALFORMED_ADDRESS_ERROR_MSG}`, function(){ - assert.throws(()=>encoding.decodeAddress(12345), new Error(encoding.MALFORMED_ADDRESS_ERROR_MSG)); -}) -// Algorand Address Tests -walletKeysFixtures.forEach(function (fixture){ - test(`decodeAddress(${fixture.encoded})`, function(){ - const decoded = encoding.decodeAddress(fixture.encoded); - assert.deepEqual(new Uint8Array(fixture.publicKey), decoded); - }) - test(`encodeAddress(${fixture.encoded})`, function() { - const address = encoding.encodeAddress(new Uint8Array(fixture.publicKey)); - assert.equal(fixture.encoded, address); - }) - - test(`decodeAddress(${fixture.encoded.slice(0, -4) + "===="}) throws ${encoding.ALGORAND_ADDRESS_BAD_CHECKSUM_ERROR_MSG}`, function(){ - assert.throws(()=>encoding.decodeAddress(fixture.encoded.slice(0, -4) + "===="), new Error(encoding.ALGORAND_ADDRESS_BAD_CHECKSUM_ERROR_MSG)) - }) - -}) diff --git a/clients/liquid-auth-core/tests/generate.fixtures.js b/clients/liquid-auth-core/tests/generate.fixtures.js deleted file mode 100644 index cc97449..0000000 --- a/clients/liquid-auth-core/tests/generate.fixtures.js +++ /dev/null @@ -1,61 +0,0 @@ -import {toBase64URL, } from "../lib/index.js"; -import * as fs from "node:fs"; -import algosdk from 'algosdk' - -const data = [ - "9b1a1b53-0456-4fcd-b10a-4db40352d58a", //OWIxYTFiNTMtMDQ1Ni00ZmNkLWIxMGEtNGRiNDAzNTJkNThh - Validated - "7646809", // Catch 7 Bits - "b1338059", // Catch 8 Bits - "582bd065-f280-4574-b315-3398c75296c5", - "29572cc5-7c36-4016-9825-abcc9ba51dae", - "2ce09bdf-69d1-4b08-b93e-3af4ca6a657a", - "15210d8d-308c-4acd-843c-ba6babada62c", - "cba26c96-51ad-40c0-b29f-6a46e0d88d43", - "c13cdc12-c7ed-41db-a669-56a664f8127a", - "8507cd12-1a02-4a48-92a5-23fbbe7ad5fe", - "02b073e9-f33c-4f06-b3aa-d94101a06494", - "064b6627-6dcb-439b-979d-a38c6a4e10f4", - "f32a0d44-6d3c-4f68-ba4d-0bc26aed6c7f", - "73b68c21-7bab-4608-ad9c-67d2fb954fa2", - "d626dd1f-50c5-4438-b920-72b852bb89cd", - "e598d7e0-282e-4ae9-909b-b18b9710b2b4", - "84c50a1a-38bb-470b-8347-68d9e323f3d8", - "53bae0ac-5462-438f-89c4-aa1204146eca", - "4b487db9-abba-40c5-a0ad-b2250878a332", - "d0941714-eae3-40db-a789-f21aa6401b0d", - "efb79528-d0bd-433e-be9f-f1020cee08fa", - "da2a799b-e1fe-460a-8f3f-0a5f4a124359", - "822dc1c2-556c-4cee-8c37-411ac530a088", - "d035ec77-dd78-4a51-8392-ad28870b0905", - "c934cf59-56a9-45f6-bdbd-7273d2ae86c8", - "b2c572bb-98e1-4d6b-b06c-865a749aacf6", - "5f571217-335c-422e-8c76-0e8b4e1296cf" -] - -const walletKeys = data.map(()=>{ - const address = algosdk.generateAccount() - return { - encoded: address.addr, - checksum: new Array(...algosdk.decodeAddress(address.addr).checksum), - publicKey: new Array(...algosdk.decodeAddress(address.addr).publicKey), - privateKey: new Array(...address.sk), - valid: true - } -}) - - -fs.writeFileSync('./tests/__fixtures__/wallet.keys.fixtures.json', JSON.stringify(walletKeys, null, 2)) - - -const encodingBase64URL = data.map((d)=>{ - const encoder = new TextEncoder() - return { - origin: d, - toBase64Url: toBase64URL(encoder.encode(d)), - fromBase64Url: new Array(...encoder.encode(d)), - } -}) - -fs.writeFileSync('./tests/__fixtures__/encoding.base64url.fixtures.json', JSON.stringify(encodingBase64URL, null, 2)) - -console.log(Buffer.from('hello', 'base32')) diff --git a/clients/liquid-auth-core/tsconfig.json b/clients/liquid-auth-core/tsconfig.json deleted file mode 100644 index 1263018..0000000 --- a/clients/liquid-auth-core/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "include": ["./src/**/*.ts"], - "compilerOptions": { - "outDir": "lib", - "declaration": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowSyntheticDefaultImports": true, - "allowJs": true, - "skipLibCheck": true, - "strictNullChecks": true - } -} diff --git a/docker-compose.yml b/docker-compose.yml index 999cfe0..4c46d0b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.5' - services: liquid-auth: build: . @@ -7,7 +5,7 @@ services: env_file: - .env.docker ports: - - "3000:3000" + - "5173:5173" depends_on: - redis - mongo diff --git a/package-lock.json b/package-lock.json index b4ea6cc..c4be4d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,6 @@ "": { "name": "liquid-auth", "workspaces": [ - "clients/**", "services/**", "sites/**" ], @@ -17,6 +16,7 @@ "clients/liquid-auth-client-js": { "name": "@liquid/auth-client", "version": "1.0.0", + "extraneous": true, "license": "MIT", "dependencies": { "@liquid/core": "^1.0.0", @@ -44,136 +44,10 @@ "typescript": "^5.4.5" } }, - "clients/liquid-auth-client-js/node_modules/@typescript-eslint/parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.6.0.tgz", - "integrity": "sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "7.6.0", - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/typescript-estree": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "clients/liquid-auth-client-js/node_modules/@typescript-eslint/scope-manager": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz", - "integrity": "sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-client-js/node_modules/@typescript-eslint/types": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.6.0.tgz", - "integrity": "sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-client-js/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz", - "integrity": "sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "clients/liquid-auth-client-js/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz", - "integrity": "sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-client-js/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "clients/liquid-auth-client-js/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "clients/liquid-auth-core": { "name": "@liquid/core", "version": "1.0.0", + "extraneous": true, "license": "MIT", "dependencies": { "tweetnacl": "^1.0.3" @@ -191,133 +65,6 @@ "typescript": "^5.4.5" } }, - "clients/liquid-auth-core/node_modules/@typescript-eslint/parser": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.6.0.tgz", - "integrity": "sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "7.6.0", - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/typescript-estree": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "clients/liquid-auth-core/node_modules/@typescript-eslint/scope-manager": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz", - "integrity": "sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-core/node_modules/@typescript-eslint/types": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.6.0.tgz", - "integrity": "sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ==", - "dev": true, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-core/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz", - "integrity": "sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "@typescript-eslint/visitor-keys": "7.6.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "clients/liquid-auth-core/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz", - "integrity": "sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "7.6.0", - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "clients/liquid-auth-core/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "clients/liquid-auth-core/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "dev": true, @@ -326,6 +73,18 @@ "node": ">=0.10.0" } }, + "node_modules/@algorandfoundation/liquid-client": { + "version": "0.0.1", + "resolved": "git+ssh://git@github.com/algorandfoundation/liquid-auth-js.git#f4e1c2ce6cde1e06e839203ab7470e3020fb48bf", + "hasInstallScript": true, + "dependencies": { + "canvas": "^2.11.2", + "eventemitter3": "^5.0.1", + "qr-code-styling": "*", + "socket.io-client": "^4.7.5", + "tweetnacl": "^1.0.3" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "dev": true, @@ -3986,14 +3745,6 @@ "resolved": "services/liquid-auth-api-js", "link": true }, - "node_modules/@liquid/auth-client": { - "resolved": "clients/liquid-auth-client-js", - "link": true - }, - "node_modules/@liquid/core": { - "resolved": "clients/liquid-auth-core", - "link": true - }, "node_modules/@lukeed/csprng": { "version": "1.1.0", "license": "MIT", @@ -4001,58 +3752,135 @@ "node": ">=8" } }, - "node_modules/@microsoft/tsdoc": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", - "integrity": "sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==" + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } }, - "node_modules/@microsoft/tsdoc-config": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz", - "integrity": "sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==", - "dev": true, + "node_modules/@mapbox/node-pre-gyp/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dependencies": { - "@microsoft/tsdoc": "0.14.2", - "ajv": "~6.12.6", - "jju": "~1.4.0", - "resolve": "~1.19.0" + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@microsoft/tsdoc-config/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, + "node_modules/@mapbox/node-pre-gyp/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@microsoft/tsdoc-config/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } }, - "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", - "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", - "dev": true, + "node_modules/@mapbox/node-pre-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dependencies": { - "is-core-module": "^2.1.0", - "path-parse": "^1.0.6" + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@microsoft/tsdoc": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", + "integrity": "sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==" + }, "node_modules/@mole-inc/bin-wrapper": { "version": "8.0.1", "dev": true, @@ -5530,24 +5358,6 @@ "integrity": "sha512-9F4ys4C74eSTEUNndnER3VJ15oru2NumfQxS8geE+f3eB5xvfxpWyqE5XlVnxb/R14uoXi6SLbBwwiDSkv+XEw==", "dev": true }, - "node_modules/@swc/register": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/@swc/register/-/register-0.1.10.tgz", - "integrity": "sha512-6STwH/q4dc3pitXLVkV7sP0Hiy+zBsU2wOF1aXpXR95pnH3RYHKIsDC+gvesfyB7jxNT9OOZgcqOp9RPxVTx9A==", - "deprecated": "Use @swc-node/register instead", - "dev": true, - "dependencies": { - "lodash.clonedeep": "^4.5.0", - "pirates": "^4.0.1", - "source-map-support": "^0.5.13" - }, - "bin": { - "swc-node": "bin/swc-node" - }, - "peerDependencies": { - "@swc/core": "^1.0.46" - } - }, "node_modules/@swc/types": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.5.tgz", @@ -5718,12 +5528,6 @@ "@types/responselike": "^1.0.0" } }, - "node_modules/@types/chai": { - "version": "4.3.14", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.14.tgz", - "integrity": "sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w==", - "dev": true - }, "node_modules/@types/connect": { "version": "3.4.36", "dev": true, @@ -5912,14 +5716,6 @@ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, - "node_modules/@types/qrcode": { - "version": "1.5.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/qs": { "version": "6.9.8", "dev": true, @@ -6883,12 +6679,6 @@ "node": ">=8" } }, - "node_modules/ansi-sequence-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", - "integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==", - "dev": true - }, "node_modules/ansi-styles": { "version": "4.3.0", "license": "MIT", @@ -7066,15 +6856,6 @@ "node": ">=12.0.0" } }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/async": { "version": "3.2.5", "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", @@ -7710,30 +7491,6 @@ "node": ">= 0.8" } }, - "node_modules/c8": { - "version": "9.1.0", - "dev": true, - "license": "ISC", - "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^3.1.1", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.6", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^17.7.2", - "yargs-parser": "^21.1.1" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": ">=14.14.0" - } - }, "node_modules/cacache": { "version": "17.1.4", "license": "ISC", @@ -7907,6 +7664,20 @@ } ] }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/cbor": { "version": "5.2.0", "license": "MIT", @@ -7918,22 +7689,6 @@ "node": ">=6.0.0" } }, - "node_modules/chai": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.0.tgz", - "integrity": "sha512-kDZ7MZyM6Q1DhR9jy7dalKohXQ2yrlXkk59CR52aRKxJrobmlBNqnFQxX9xOX8w+4mz8SYlKJa/7D7ddltFXCw==", - "dev": true, - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.0.0", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/chalk": { "version": "4.1.2", "license": "MIT", @@ -7961,15 +7716,6 @@ "dev": true, "license": "MIT" }, - "node_modules/check-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.0.0.tgz", - "integrity": "sha512-tjLAOBHKVxtPoHe/SA7kNOMvhCRdCJ3vETdeY0RuAc9popf+hyaSV6ZEg9hr4cpWF7jmo/JSWEnLDrnijS9Tog==", - "dev": true, - "engines": { - "node": ">= 16" - } - }, "node_modules/chokidar": { "version": "3.5.3", "dev": true, @@ -8710,15 +8456,6 @@ } } }, - "node_modules/deep-eql": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.1.tgz", - "integrity": "sha512-nwQCf6ne2gez3o1MxWifqkciwt0zhl0LO1/UwVu4uMBuPmflWM4oQ70XMqHqnBJA+nhzncaqL9HVL6KkHJ28lw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/deep-is": { "version": "0.1.4", "dev": true, @@ -9473,16 +9210,6 @@ "eslint": ">=7" } }, - "node_modules/eslint-plugin-tsdoc": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz", - "integrity": "sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==", - "dev": true, - "dependencies": { - "@microsoft/tsdoc": "0.14.2", - "@microsoft/tsdoc-config": "0.16.2" - } - }, "node_modules/eslint-scope": { "version": "7.2.2", "dev": true, @@ -10386,15 +10113,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -10455,18 +10173,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-tsconfig": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", - "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", - "dev": true, - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "7.2.3", "license": "ISC", @@ -11406,15 +11112,6 @@ "version": "2.0.0", "license": "ISC" }, - "node_modules/isomorphic-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz", - "integrity": "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==", - "dependencies": { - "node-fetch": "^2.6.1", - "whatwg-fetch": "^3.4.1" - } - }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "dev": true, @@ -12069,12 +11766,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jju": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", - "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", - "dev": true - }, "node_modules/js-sha256": { "version": "0.9.0", "license": "MIT" @@ -12280,12 +11971,6 @@ "version": "4.17.21", "license": "MIT" }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -12342,15 +12027,6 @@ "loose-envify": "cli.js" } }, - "node_modules/loupe": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.0.tgz", - "integrity": "sha512-qKl+FrLXUhFuHUoDJG7f8P8gEMHq9NFS0c6ghXG1J0rldmZFQZoNVv/vyirE9qwCIhWZDsvEFd1sbFu3GvRQFg==", - "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } - }, "node_modules/lowercase-keys": { "version": "2.0.0", "dev": true, @@ -12373,12 +12049,6 @@ "yallist": "^3.0.2" } }, - "node_modules/lunr": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", - "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", - "dev": true - }, "node_modules/macos-release": { "version": "2.5.1", "dev": true, @@ -12466,18 +12136,6 @@ "tmpl": "1.0.5" } }, - "node_modules/marked": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", - "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", - "dev": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, "node_modules/mdn-data": { "version": "2.0.30", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", @@ -12924,6 +12582,11 @@ "dev": true, "license": "ISC" }, + "node_modules/nan": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -13474,15 +13137,6 @@ "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, - "node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", - "dev": true, - "engines": { - "node": ">= 14.16" - } - }, "node_modules/peek-readable": { "version": "5.0.0", "dev": true, @@ -14240,15 +13894,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/resolve.exports": { "version": "2.0.2", "dev": true, @@ -14774,18 +14419,6 @@ "node": ">=4" } }, - "node_modules/shiki": { - "version": "0.14.7", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.14.7.tgz", - "integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==", - "dev": true, - "dependencies": { - "ansi-sequence-parser": "^1.1.0", - "jsonc-parser": "^3.2.0", - "vscode-oniguruma": "^1.7.0", - "vscode-textmate": "^8.0.0" - } - }, "node_modules/side-channel": { "version": "1.0.4", "license": "MIT", @@ -14806,6 +14439,57 @@ "version": "3.0.7", "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-get/node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/simple-get/node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -14866,9 +14550,9 @@ } }, "node_modules/socket.io-client": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.4.tgz", - "integrity": "sha512-wh+OkeF0rAVCrABWQBaEjLfb7DVPotMbu0cgWgyR0v6eA4EoVnAwcIeIbcdTE3GT/H3kbdLl7OoH2+asoDRIIg==", + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz", + "integrity": "sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.2", @@ -15910,25 +15594,6 @@ "version": "2.6.2", "license": "0BSD" }, - "node_modules/tsx": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.2.tgz", - "integrity": "sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==", - "dev": true, - "dependencies": { - "esbuild": "~0.19.10", - "get-tsconfig": "^4.7.2" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -16053,60 +15718,6 @@ "version": "0.0.6", "license": "MIT" }, - "node_modules/typedoc": { - "version": "0.25.13", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.13.tgz", - "integrity": "sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==", - "dev": true, - "dependencies": { - "lunr": "^2.3.9", - "marked": "^4.3.0", - "minimatch": "^9.0.3", - "shiki": "^0.14.7" - }, - "bin": { - "typedoc": "bin/typedoc" - }, - "engines": { - "node": ">= 16" - }, - "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" - } - }, - "node_modules/typedoc-plugin-markdown": { - "version": "4.0.0-next.58", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.0.0-next.58.tgz", - "integrity": "sha512-qIpinPrmz75gkKcveXNcCIxtKeNM+u/LGx+L9Cp2qOv0vCR3Vi5ONWVFq3P5XIAkoRFnLZXx6NaLcey+GuQuUA==", - "dev": true, - "peerDependencies": { - "typedoc": "0.25.x" - } - }, - "node_modules/typedoc/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/typedoc/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/typescript": { "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", @@ -16486,18 +16097,6 @@ "version": "2.0.4", "license": "MIT" }, - "node_modules/vscode-oniguruma": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", - "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==", - "dev": true - }, - "node_modules/vscode-textmate": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-8.0.0.tgz", - "integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==", - "dev": true - }, "node_modules/walker": { "version": "1.0.8", "dev": true, @@ -16612,11 +16211,6 @@ "node": ">=4.0" } }, - "node_modules/whatwg-fetch": { - "version": "3.6.20", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", - "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==" - }, "node_modules/whatwg-url": { "version": "5.0.0", "license": "MIT", @@ -17436,7 +17030,6 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@liquid/core": "^1.0.0", "@nestjs/common": "^10.2.6", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.2.6", @@ -17500,10 +17093,10 @@ "version": "0.0.1", "license": "MIT", "dependencies": { + "@algorandfoundation/liquid-client": "github:algorandfoundation/liquid-auth-js#develop", "@emotion/react": "^11.11.3", "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", - "@liquid/auth-client": "^1.0.0", "@mui/icons-material": "^5.15.4", "@mui/material": "^5.15.4", "@tanstack/react-query": "^5.20.5", @@ -17565,21 +17158,15 @@ "devDependencies": { "@nestjs/cli": "^10.0.0", "@nestjs/schematics": "^10.0.0", - "@nestjs/testing": "^10.0.0", "@types/express": "^4.17.17", - "@types/jest": "^29.5.2", "@types/node": "^20.3.1", - "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "eslint": "^8.42.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", - "jest": "^29.5.0", "prettier": "^3.0.0", "source-map-support": "^0.5.21", - "supertest": "^6.3.3", - "ts-jest": "^29.1.0", "ts-loader": "^9.4.3", "ts-node": "^10.9.1", "tsconfig-paths": "^4.2.0", diff --git a/package.json b/package.json index 23cc77b..5ac9c8a 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,8 @@ "scripts": { "dev": "concurrently \"npm:dev:*\"", "dev:api": "npm run dev --if-present --workspace @liquid/auth-api", - "dev:core": "npm run dev --if-present --workspace @liquid/core", - "dev:sdk": "npm run dev --if-present --workspace @liquid/auth-client", "dev:ui": "npm run dev --if-present --workspace dapp-ui", - "build": "npm run build --workspace @liquid/core && npm run build --workspace @liquid/auth-client && npm run build --workspace @liquid/auth-api && npm run build --workspace dapp-ui && npm run build --workspace express-dapp", + "build": "npm run build --workspace @liquid/auth-api && npm run build --workspace dapp-ui && npm run build --workspace express-dapp", "lint": "npm run lint --if-present --ws", "test": "npm run test --if-present --ws", "test:cov": "npm run test:cov --if-present --ws", @@ -15,7 +13,6 @@ "start:ssr": "npm run start:prod --workspace express-dapp" }, "workspaces": [ - "clients/**", "services/**", "sites/**" ], diff --git a/services/liquid-auth-api-js/.eslintrc.json b/services/liquid-auth-api-js/.eslintrc.json index 8cd93a2..8c05947 100644 --- a/services/liquid-auth-api-js/.eslintrc.json +++ b/services/liquid-auth-api-js/.eslintrc.json @@ -17,6 +17,8 @@ "jest": true }, "ignorePatterns": [ + "src/encoding/hi-base32.ts", + "src/encoding/sha512.ts", ".eslintrc.js", "dist/**" ], diff --git a/services/liquid-auth-api-js/package.json b/services/liquid-auth-api-js/package.json index 495121b..c13e08e 100644 --- a/services/liquid-auth-api-js/package.json +++ b/services/liquid-auth-api-js/package.json @@ -34,7 +34,6 @@ "sentry:sourcemaps": "sentry-cli sourcemaps inject --org phearzero --project node-express dist && sentry-cli sourcemaps upload --org phearzero --project node-express dist" }, "dependencies": { - "@liquid/core": "^1.0.0", "@nestjs/common": "^10.2.6", "@nestjs/config": "^3.1.1", "@nestjs/core": "^10.2.6", @@ -115,11 +114,13 @@ "**/*.(t|j)s" ], "coveragePathIgnorePatterns": [ + "index.ts", "/node_modules/", "/test/", "/dist/", "/src/main.ts", - "/src/adapters/redis-io.adapter.ts" + "/src/adapters/redis-io.adapter.ts", + "/src/encoding/" ], "coverageDirectory": "../coverage", "testEnvironment": "node" diff --git a/services/liquid-auth-api-js/src/app.service.ts b/services/liquid-auth-api-js/src/app.service.ts index f66f084..74edf5d 100644 --- a/services/liquid-auth-api-js/src/app.service.ts +++ b/services/liquid-auth-api-js/src/app.service.ts @@ -1,7 +1,7 @@ import { Injectable, Logger } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import UAParser from 'ua-parser-js'; -import { toBase64URL } from '@liquid/core'; +import { toBase64URL } from './encoding/index.js'; //@ts-ignore, required for jest import assetLinks from '../assetlinks.json' assert { type: 'json' }; diff --git a/services/liquid-auth-api-js/src/attestation/attestation.service.ts b/services/liquid-auth-api-js/src/attestation/attestation.service.ts index ca131b8..946540c 100644 --- a/services/liquid-auth-api-js/src/attestation/attestation.service.ts +++ b/services/liquid-auth-api-js/src/attestation/attestation.service.ts @@ -4,7 +4,7 @@ import { AppService } from '../app.service.js'; import * as fido2 from '@simplewebauthn/server'; import { AttestationSelectorDto } from './attestation.dto.js'; import type { AttestationCredentialJSON } from '@simplewebauthn/typescript-types'; -import { decodeAddress, fromBase64Url } from '@liquid/core'; +import { decodeAddress, fromBase64Url } from '../encoding/index.js'; import nacl from 'tweetnacl'; import { AlgodService } from '../algod/algod.service.js'; @Injectable() diff --git a/services/liquid-auth-api-js/src/auth/auth.service.ts b/services/liquid-auth-api-js/src/auth/auth.service.ts index 2113e9f..afaa464 100644 --- a/services/liquid-auth-api-js/src/auth/auth.service.ts +++ b/services/liquid-auth-api-js/src/auth/auth.service.ts @@ -2,7 +2,7 @@ import * as crypto from 'node:crypto'; import { Injectable, Logger } from '@nestjs/common'; import { InjectModel } from '@nestjs/mongoose'; import { Model } from 'mongoose'; -import { toBase64URL } from '@liquid/core/encoding'; +import { toBase64URL } from '../encoding/index.js'; import type { FilterQuery } from 'mongoose'; import { Credential, User } from './auth.schema.js'; import { Session } from './session.schema.js'; diff --git a/clients/liquid-auth-core/src/encoding.ts b/services/liquid-auth-api-js/src/encoding/encoding.ts similarity index 84% rename from clients/liquid-auth-core/src/encoding.ts rename to services/liquid-auth-api-js/src/encoding/encoding.ts index 1aae877..a055f1a 100644 --- a/clients/liquid-auth-core/src/encoding.ts +++ b/services/liquid-auth-api-js/src/encoding/encoding.ts @@ -1,17 +1,17 @@ -import nacl from "tweetnacl"; -import { decodeAsBytes, encodeBytes } from "./hi-base32.js"; -import { createMethod } from "./sha512.js"; +import nacl from 'tweetnacl'; +import { decodeAsBytes, encodeBytes } from './hi-base32.js'; +import { createMethod } from './sha512.js'; const sha512_256 = createMethod(256); const chars = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; const ALGORAND_PUBLIC_KEY_BYTE_LENGTH = 32; const ALGORAND_ADDRESS_BYTE_LENGTH = 36; const ALGORAND_CHECKSUM_BYTE_LENGTH = 4; const ALGORAND_ADDRESS_LENGTH = 58; const HASH_BYTES_LENGTH = 32; -export const MALFORMED_ADDRESS_ERROR_MSG = "Malformed address"; -export const ALGORAND_ADDRESS_BAD_CHECKSUM_ERROR_MSG = "Bad checksum"; -export const INVALID_BASE64URL_INPUT = "Invalid base64url input"; +export const MALFORMED_ADDRESS_ERROR_MSG = 'Malformed address'; +export const ALGORAND_ADDRESS_BAD_CHECKSUM_ERROR_MSG = 'Bad checksum'; +export const INVALID_BASE64URL_INPUT = 'Invalid base64url input'; /** * Bytes to Base64URL @@ -20,7 +20,7 @@ export const INVALID_BASE64URL_INPUT = "Invalid base64url input"; export function toBase64URL(arr: Uint8Array | ArrayBuffer): string { const bytes = arr instanceof Uint8Array ? arr : new Uint8Array(arr); const len = bytes.length; - let base64 = ""; + let base64 = ''; for (let i = 0; i < len; i += 3) { base64 += chars[bytes[i] >> 2]; base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; @@ -42,13 +42,13 @@ export function toBase64URL(arr: Uint8Array | ArrayBuffer): string { * @param {string} base64url URL safe Base64 string */ export function fromBase64Url(base64url: string): Uint8Array { - if (typeof base64url !== "string") { + if (typeof base64url !== 'string') { throw new Error(INVALID_BASE64URL_INPUT); } return new Uint8Array( // TODO: Cross-platform solution since atob is deprecated in Node - atob(base64url.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")) - .split("") + atob(base64url.replace(/-/g, '+').replace(/_/g, '/').replace(/\s/g, '')) + .split('') .map((c) => c.charCodeAt(0)), ); } @@ -85,7 +85,7 @@ export function encodeAddress(address: Uint8Array) { */ export function decodeAddress(address: string): Uint8Array { if ( - typeof address !== "string" || + typeof address !== 'string' || address.length !== ALGORAND_ADDRESS_LENGTH ) { throw new Error(MALFORMED_ADDRESS_ERROR_MSG); diff --git a/clients/liquid-auth-core/src/hi-base32.ts b/services/liquid-auth-api-js/src/encoding/hi-base32.ts similarity index 95% rename from clients/liquid-auth-core/src/hi-base32.ts rename to services/liquid-auth-api-js/src/encoding/hi-base32.ts index c6bdc80..0a89b9b 100644 --- a/clients/liquid-auth-core/src/hi-base32.ts +++ b/services/liquid-auth-api-js/src/encoding/hi-base32.ts @@ -6,7 +6,7 @@ * @copyright Chen, Yi-Cyuan 2015-2021 * @license MIT */ -const BASE32_ENCODE_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""); +const BASE32_ENCODE_CHAR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'.split(''); const BASE32_DECODE_CHAR: Record = { A: 0, B: 1, @@ -43,12 +43,12 @@ const BASE32_DECODE_CHAR: Record = { }; export const decodeAsBytes = function (base32Str: string): number[] { - if (base32Str === "") { + if (base32Str === '') { return []; } else if (!/^[A-Z2-7=]+$/.test(base32Str)) { - throw new Error("Invalid base32 characters"); + throw new Error('Invalid base32 characters'); } - base32Str = base32Str.replace(/=/g, ""); + base32Str = base32Str.replace(/=/g, ''); let v1; let v2; let v3; @@ -122,7 +122,7 @@ export const encodeBytes = function (bytes: Uint8Array) { let v3; let v4; let v5; - let base32Str = ""; + let base32Str = ''; const length = bytes.length; for ( var i = 0, count = parseInt((length / 5) as unknown as string) * 5; @@ -152,7 +152,7 @@ export const encodeBytes = function (bytes: Uint8Array) { base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[(v1 << 2) & 31] + - "======"; + '======'; } else if (remain === 2) { v1 = bytes[i++]; v2 = bytes[i]; @@ -161,7 +161,7 @@ export const encodeBytes = function (bytes: Uint8Array) { BASE32_ENCODE_CHAR[((v1 << 2) | (v2 >>> 6)) & 31] + BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + BASE32_ENCODE_CHAR[(v2 << 4) & 31] + - "===="; + '===='; } else if (remain === 3) { v1 = bytes[i++]; v2 = bytes[i++]; @@ -172,7 +172,7 @@ export const encodeBytes = function (bytes: Uint8Array) { BASE32_ENCODE_CHAR[(v2 >>> 1) & 31] + BASE32_ENCODE_CHAR[((v2 << 4) | (v3 >>> 4)) & 31] + BASE32_ENCODE_CHAR[(v3 << 1) & 31] + - "==="; + '==='; } else if (remain === 4) { v1 = bytes[i++]; v2 = bytes[i++]; @@ -186,7 +186,7 @@ export const encodeBytes = function (bytes: Uint8Array) { BASE32_ENCODE_CHAR[((v3 << 1) | (v4 >>> 7)) & 31] + BASE32_ENCODE_CHAR[(v4 >>> 2) & 31] + BASE32_ENCODE_CHAR[(v4 << 3) & 31] + - "="; + '='; } return base32Str; }; diff --git a/services/liquid-auth-api-js/src/encoding/index.ts b/services/liquid-auth-api-js/src/encoding/index.ts new file mode 100644 index 0000000..243f84b --- /dev/null +++ b/services/liquid-auth-api-js/src/encoding/index.ts @@ -0,0 +1 @@ +export * from './encoding.js'; diff --git a/clients/liquid-auth-core/src/sha512.ts b/services/liquid-auth-api-js/src/encoding/sha512.ts similarity index 98% rename from clients/liquid-auth-core/src/sha512.ts rename to services/liquid-auth-api-js/src/encoding/sha512.ts index 129aaab..ece1545 100644 --- a/clients/liquid-auth-core/src/sha512.ts +++ b/services/liquid-auth-api-js/src/encoding/sha512.ts @@ -6,11 +6,11 @@ * @copyright Chen, Yi-Cyuan 2014-2024 * @license MIT */ -const INPUT_ERROR = "input is invalid type"; -const FINALIZE_ERROR = "finalize already called"; +const INPUT_ERROR = 'input is invalid type'; +const FINALIZE_ERROR = 'finalize already called'; -const ARRAY_BUFFER = typeof ArrayBuffer !== "undefined"; -const HEX_CHARS = "0123456789abcdef".split(""); +const ARRAY_BUFFER = typeof ArrayBuffer !== 'undefined'; +const HEX_CHARS = '0123456789abcdef'.split(''); const EXTRA = [-2147483648, 8388608, 32768, 128]; const SHIFT = [24, 16, 8, 0]; const K = [ @@ -43,7 +43,7 @@ const K = [ 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817, ]; -const OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"]; +const OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer']; const blocks: number[] = []; @@ -55,10 +55,10 @@ const formatMessage = function ( message: string | ArrayBuffer | ArrayBufferView, ) { const type = typeof message; - if (type === "string") { + if (type === 'string') { return [message, true]; } - if (type !== "object" || message === null) { + if (type !== 'object' || message === null) { throw new Error(INPUT_ERROR); } if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { @@ -82,7 +82,7 @@ const createOutputMethod = function ( export const createMethod = function (bits): { array: (d: Uint8Array) => Uint8Array; } { - const method = createOutputMethod("hex", bits); + const method = createOutputMethod('hex', bits); //@ts-expect-error, create does exits on the prototype method.create = function () { return new (Sha512 as any)(bits); @@ -1202,28 +1202,28 @@ Sha512.prototype.clone = function () { Sha512.prototype.copyTo = function (hash) { let i = 0; const attrs = [ - "h0h", - "h0l", - "h1h", - "h1l", - "h2h", - "h2l", - "h3h", - "h3l", - "h4h", - "h4l", - "h5h", - "h5l", - "h6h", - "h6l", - "h7h", - "h7l", - "start", - "bytes", - "hBytes", - "finalized", - "hashed", - "lastByteIndex", + 'h0h', + 'h0l', + 'h1h', + 'h1l', + 'h2h', + 'h2l', + 'h3h', + 'h3l', + 'h4h', + 'h4l', + 'h5h', + 'h5l', + 'h6h', + 'h6l', + 'h7h', + 'h7l', + 'start', + 'bytes', + 'hBytes', + 'finalized', + 'hashed', + 'lastByteIndex', ]; for (i = 0; i < attrs.length; ++i) { hash[attrs[i]] = this[attrs[i]]; diff --git a/services/liquid-auth-api-js/tests/constants.ts b/services/liquid-auth-api-js/tests/constants.ts index 0e5daa7..fd3305b 100644 --- a/services/liquid-auth-api-js/tests/constants.ts +++ b/services/liquid-auth-api-js/tests/constants.ts @@ -1,4 +1,4 @@ -import { decodeAddress } from '@liquid/core/encoding'; +import { decodeAddress } from '../src/encoding/index.js'; import * as crypto from 'node:crypto'; export const accFixture = { diff --git a/sites/dapp-ui/package.json b/sites/dapp-ui/package.json index 3ccfed0..3135535 100644 --- a/sites/dapp-ui/package.json +++ b/sites/dapp-ui/package.json @@ -12,10 +12,10 @@ "lint": "eslint \"{src,apps,libs,test}/**/*.{ts,tsx}\" --fix" }, "dependencies": { + "@algorandfoundation/liquid-client": "github:algorandfoundation/liquid-auth-js#develop", "@emotion/react": "^11.11.3", "@emotion/server": "^11.11.0", "@emotion/styled": "^11.11.0", - "@liquid/auth-client": "^1.0.0", "@mui/icons-material": "^5.15.4", "@mui/material": "^5.15.4", "@tanstack/react-query": "^5.20.5", diff --git a/sites/dapp-ui/src/App.tsx b/sites/dapp-ui/src/App.tsx index 0f51e13..4c9eae2 100644 --- a/sites/dapp-ui/src/App.tsx +++ b/sites/dapp-ui/src/App.tsx @@ -13,7 +13,7 @@ import { HomePage, ConnectedPage } from '@/pages'; import { Algodv2 } from 'algosdk'; import { AlgodContext } from '@/hooks'; import { SignalClientContext } from '@/hooks/useSignalClient.ts'; -import { LinkMessage, SignalClient } from '@liquid/auth-client/signal'; +import { LinkMessage, SignalClient } from '@algorandfoundation/liquid-client'; import { useAddressStore } from '@/store'; const queryClient = new QueryClient(); diff --git a/sites/dapp-ui/src/components/ConnectModal.tsx b/sites/dapp-ui/src/components/ConnectModal.tsx index 41f9b66..517ab25 100644 --- a/sites/dapp-ui/src/components/ConnectModal.tsx +++ b/sites/dapp-ui/src/components/ConnectModal.tsx @@ -6,7 +6,7 @@ import { useState } from 'react'; import { Fade } from '@mui/material'; import { useNavigate } from 'react-router-dom'; import { useSignalClient } from '@/hooks/useSignalClient.ts'; -import { SignalClient } from '@liquid/auth-client/signal'; +import { SignalClient } from '@algorandfoundation/liquid-client'; const style = { position: 'absolute' as const, top: '50%', diff --git a/sites/dapp-ui/src/hooks/useSignalClient.ts b/sites/dapp-ui/src/hooks/useSignalClient.ts index 7d1cf3d..42de87f 100644 --- a/sites/dapp-ui/src/hooks/useSignalClient.ts +++ b/sites/dapp-ui/src/hooks/useSignalClient.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react'; -import { SignalClient } from '@liquid/auth-client/signal'; +import { SignalClient } from '@algorandfoundation/liquid-client'; type SignalClientState = { client: SignalClient | null; diff --git a/sites/dapp-ui/src/pages/connected.tsx b/sites/dapp-ui/src/pages/connected.tsx index cf48daf..a80505f 100644 --- a/sites/dapp-ui/src/pages/connected.tsx +++ b/sites/dapp-ui/src/pages/connected.tsx @@ -7,7 +7,7 @@ import { waitForConfirmation, makePaymentTxnWithSuggestedParamsFromObject, } from 'algosdk'; -import { toBase64URL, fromBase64Url } from '@liquid/core/encoding'; +import { toBase64URL, fromBase64Url } from '@algorandfoundation/liquid-client'; import { useAlgod } from '@/hooks/useAlgod.ts'; import { useAccountInfo } from '@/hooks/useAccountInfo.ts'; import FormControl from '@mui/material/FormControl'; diff --git a/sites/dapp-ui/src/pages/home.tsx b/sites/dapp-ui/src/pages/home.tsx index ec49c5f..6d384a2 100644 --- a/sites/dapp-ui/src/pages/home.tsx +++ b/sites/dapp-ui/src/pages/home.tsx @@ -6,7 +6,7 @@ import Card from '@mui/material/Card'; import Button from '@mui/material/Button'; import { ConnectModal } from '@/components/ConnectModal'; -import { assertion } from '@liquid/auth-client/assertion'; +import { assertion } from '@algorandfoundation/liquid-client'; import { useState } from 'react'; export function HomePage() {