diff --git a/backend/.env.example b/backend/.env.example new file mode 100644 index 00000000..f938dd44 --- /dev/null +++ b/backend/.env.example @@ -0,0 +1,9 @@ +# PezkuwiChain WebSocket Endpoint +WS_ENDPOINT=wss://ws.pezkuwichain.io + +# Sudo account seed phrase for auto-approval +# This account will sign approve_kyc transactions when threshold is reached +SUDO_SEED=your_seed_phrase_here + +# Server port +PORT=3001 diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 00000000..a9e9f12e --- /dev/null +++ b/backend/README.md @@ -0,0 +1,350 @@ +# 🏛️ KYC Council Backend + +Backend simulation of pallet-collective voting for KYC approvals. + +## 📋 Overview + +**Purpose:** Decentralized KYC approval system without runtime changes + +**Architecture:** +- Backend tracks council votes (in-memory) +- 60% threshold (e.g., 7/11 votes) +- Auto-executes approve_kyc when threshold reached +- Uses SUDO account to sign blockchain transactions + +## 🔗 Chain Flow + +``` +User applies → Blockchain (PENDING) → Council votes → Backend auto-approves → Welati NFT minted +``` + +**Why SUDO account?** +- `identityKyc.approveKyc()` requires `EnsureRoot` origin +- Backend signs transactions on behalf of council +- Alternative: Change runtime to accept council origin (not needed for MVP) + +--- + +## 🚀 Installation + +### 1. Install Dependencies + +```bash +cd /home/mamostehp/pwap/backend +npm install +``` + +### 2. Configure Environment + +```bash +cp .env.example .env +nano .env +``` + +**Required variables:** +```env +WS_ENDPOINT=wss://ws.pezkuwichain.io +SUDO_SEED=your_sudo_seed_phrase_here +PORT=3001 +``` + +⚠️ **Security Warning:** Keep SUDO_SEED secret! Use a dedicated account for KYC approvals only. + +### 3. Start Server + +**Development (with hot reload):** +```bash +npm run dev +``` + +**Production:** +```bash +npm start +``` + +--- + +## 📡 API Endpoints + +### Council Management + +#### Add Council Member +```bash +POST /api/council/add-member +{ + "address": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "signature": "0x..." // TODO: Implement signature verification +} +``` + +#### Remove Council Member +```bash +POST /api/council/remove-member +{ + "address": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" +} +``` + +#### Get Council Members +```bash +GET /api/council/members +``` + +Response: +```json +{ + "members": ["5DFw...Dwd3", "5Grw...utQY"], + "totalMembers": 2, + "threshold": 0.6, + "votesRequired": 2 +} +``` + +#### Sync with Noter Tiki Holders +```bash +POST /api/council/sync-notaries +``` + +Auto-fetches first 10 Noter tiki holders from blockchain and updates council. + +--- + +### KYC Voting + +#### Propose KYC Approval +```bash +POST /api/kyc/propose +{ + "userAddress": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "proposerAddress": "5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3", + "signature": "0x..." +} +``` + +**Logic:** +- Proposer auto-votes AYE +- If threshold already met (e.g., 1/1 member), auto-executes immediately + +#### Vote on Proposal +```bash +POST /api/kyc/vote +{ + "userAddress": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "voterAddress": "5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3", + "approve": true, + "signature": "0x..." +} +``` + +**Approve:** true = AYE, false = NAY + +**Auto-execute:** If votes reach threshold, backend signs and submits `approve_kyc` transaction. + +#### Get Pending Proposals +```bash +GET /api/kyc/pending +``` + +Response: +```json +{ + "pending": [ + { + "userAddress": "5Grw...utQY", + "proposer": "5DFw...Dwd3", + "ayes": ["5DFw...Dwd3", "5HpG...vSKr"], + "nays": [], + "timestamp": 1700000000000, + "votesCount": 2, + "threshold": 7, + "status": "VOTING" + } + ] +} +``` + +--- + +## 🔐 Council Membership Rules + +### Initial Setup +- **1 member:** Founder delegate (hardcoded: `5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3`) +- **Threshold:** 1/1 = 100% (single vote approves) + +### Growth Path +1. **Add Noter holders:** Use `/api/council/sync-notaries` to fetch first 10 Noter tiki holders +2. **Council size:** 11 members (1 founder + 10 notaries) +3. **Threshold:** 7/11 = 63.6% (60% threshold met) + +### Automatic Updates +- When Noter loses tiki → Remove from council +- When new Noter available → Add to council (first 10 priority) +- If no Notaries available → Serok (president) can appoint manually + +--- + +## 🧪 Testing + +### Test 1: Single Member (Founder Only) +```bash +# 1. Start backend +npm run dev + +# 2. Get council members +curl http://localhost:3001/api/council/members + +# Expected: 1 member (founder delegate) + +# 3. User applies KYC (via frontend) +# 4. Propose approval +curl -X POST http://localhost:3001/api/kyc/propose \ + -H "Content-Type: application/json" \ + -d '{ + "userAddress": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "proposerAddress": "5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3" + }' + +# Expected: Auto-execute (1/1 threshold reached) +``` + +### Test 2: 3 Members +```bash +# 1. Add 2 notaries +curl -X POST http://localhost:3001/api/council/add-member \ + -d '{"address": "5HpG...vSKr"}' + +curl -X POST http://localhost:3001/api/council/add-member \ + -d '{"address": "5FLe...dXRp"}' + +# 2. Council: 3 members, threshold = 2 votes (60% of 3 = 1.8 → ceil = 2) + +# 3. Propose +curl -X POST http://localhost:3001/api/kyc/propose \ + -d '{ + "userAddress": "5Grw...utQY", + "proposerAddress": "5DFw...Dwd3" + }' + +# Status: 1/2 (proposer voted AYE) + +# 4. Vote from member 2 +curl -X POST http://localhost:3001/api/kyc/vote \ + -d '{ + "userAddress": "5Grw...utQY", + "voterAddress": "5HpG...vSKr", + "approve": true + }' + +# Expected: Auto-execute (2/2 threshold reached) ✅ +``` + +--- + +## 📊 Monitoring + +### Health Check +```bash +GET /health +``` + +Response: +```json +{ + "status": "ok", + "blockchain": "connected", + "sudoAccount": "5DFw...Dwd3", + "councilMembers": 11, + "pendingVotes": 3 +} +``` + +### Console Logs +``` +🔗 Connecting to PezkuwiChain... +✅ Sudo account loaded: 5DFw...Dwd3 +✅ Connected to blockchain +📊 Chain: PezkuwiChain +🏛️ Runtime version: 106 + +🚀 KYC Council Backend running on port 3001 +📊 Council members: 1 +🎯 Threshold: 60% + +📝 KYC proposal created for 5Grw...utQY by 5DFw...Dwd3 +📊 Votes: 1/1 (1 members, 60% threshold) +🎉 Threshold reached for 5Grw...utQY! Executing approve_kyc... +📡 Transaction status: Ready +📡 Transaction status: InBlock +✅ KYC APPROVED for 5Grw...utQY +🏛️ User will receive Welati NFT automatically +``` + +--- + +## 🔄 Integration with Frontend + +### Option A: Direct Backend API Calls +Frontend calls backend endpoints directly (simpler for MVP). + +```typescript +// Propose KYC approval +const response = await fetch('http://localhost:3001/api/kyc/propose', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + userAddress: application.address, + proposerAddress: selectedAccount.address, + signature: await signMessage(...) + }) +}); +``` + +### Option B: Blockchain Events + Backend Sync +Backend listens to blockchain events and auto-tracks proposals (future enhancement). + +--- + +## 🚨 Security Considerations + +1. **SUDO Account Protection:** + - Use dedicated hardware wallet (Ledger recommended) + - Only use for KYC approvals, nothing else + - Consider multi-sig in production + +2. **Signature Verification:** + - TODO: Implement Polkadot signature verification + - Prevent vote spam from non-members + +3. **Rate Limiting:** + - Add rate limiting to API endpoints + - Prevent DoS attacks + +4. **Audit Trail:** + - Log all votes to database (future enhancement) + - Track council member changes + +--- + +## 📝 TODO + +- [ ] Implement signature verification +- [ ] Add database persistence (replace in-memory Maps) +- [ ] Add rate limiting middleware +- [ ] Add automated council sync cron job +- [ ] Add multi-sig support for sudo account +- [ ] Add audit logging +- [ ] Add Prometheus metrics +- [ ] Add Docker support + +--- + +## 📞 Support + +**Backend Developer:** [Your contact] +**Runtime Issues:** Check `/Pezkuwi-SDK/pezkuwi/pallets/identity-kyc` +**Frontend Integration:** See `/pwap/ADMIN_KYC_GUIDE.md` + +--- + +**Version:** 1.0 (Backend Council MVP) +**Last Updated:** 17 Kasım 2025 diff --git a/backend/package-lock.json b/backend/package-lock.json new file mode 100644 index 00000000..71a16d71 --- /dev/null +++ b/backend/package-lock.json @@ -0,0 +1,2153 @@ +{ + "name": "pezkuwi-kyc-backend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "pezkuwi-kyc-backend", + "version": "1.0.0", + "dependencies": { + "@polkadot/api": "^10.11.1", + "@polkadot/keyring": "^12.5.1", + "@polkadot/util-crypto": "^12.5.1", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "express": "^4.18.2" + }, + "devDependencies": { + "nodemon": "^3.0.2" + } + }, + "node_modules/@noble/curves": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@polkadot-api/client": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/client/-/client-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-0fqK6pUKcGHSG2pBvY+gfSS+1mMdjd/qRygAcKI5d05tKsnZLRnmhb9laDguKmGEIB0Bz9vQqNK3gIN/cfvVwg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/metadata-builders": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/substrate-bindings": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/substrate-client": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/utils": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + }, + "peerDependencies": { + "rxjs": ">=7.8.0" + } + }, + "node_modules/@polkadot-api/json-rpc-provider": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-EaUS9Fc3wsiUr6ZS43PQqaRScW7kM6DYbuM/ou0aYjm8N9MBqgDbGm2oL6RE1vAVmOfEuHcXZuZkhzWtyvQUtA==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot-api/json-rpc-provider-proxy": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-0hZ8vtjcsyCX8AyqP2sqUHa1TFFfxGWmlXJkit0Nqp9b32MwZqn5eaUAiV2rNuEpoglKOdKnkGtUF8t5MoodKw==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot-api/metadata-builders": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-BD7rruxChL1VXt0icC2gD45OtT9ofJlql0qIllHSRYgama1CR2Owt+ApInQxB+lWqM+xNOznZRpj8CXNDvKIMg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/substrate-bindings": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/utils": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0" + } + }, + "node_modules/@polkadot-api/substrate-bindings": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-N4vdrZopbsw8k57uG58ofO7nLXM4Ai7835XqakN27MkjXMp5H830A1KJE0L9sGQR7ukOCDEIHHcwXVrzmJ/PBg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@noble/hashes": "^1.3.1", + "@polkadot-api/utils": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@scure/base": "^1.1.1", + "scale-ts": "^1.6.0" + } + }, + "node_modules/@polkadot-api/substrate-client": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-client/-/substrate-client-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-lcdvd2ssUmB1CPzF8s2dnNOqbrDa+nxaaGbuts+Vo8yjgSKwds2Lo7Oq+imZN4VKW7t9+uaVcKFLMF7PdH0RWw==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot-api/utils": { + "version": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0.tgz", + "integrity": "sha512-0CYaCjfLQJTCRCiYvZ81OncHXEKPzAexCMoVloR+v2nl/O2JRya/361MtPkeNLC6XBoaEgLAG9pWQpH3WePzsw==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot/api": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-10.13.1.tgz", + "integrity": "sha512-YrKWR4TQR5CDyGkF0mloEUo7OsUA+bdtENpJGOtNavzOQUDEbxFE0PVzokzZfVfHhHX2CojPVmtzmmLxztyJkg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api-augment": "10.13.1", + "@polkadot/api-base": "10.13.1", + "@polkadot/api-derive": "10.13.1", + "@polkadot/keyring": "^12.6.2", + "@polkadot/rpc-augment": "10.13.1", + "@polkadot/rpc-core": "10.13.1", + "@polkadot/rpc-provider": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/types-augment": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/types-create": "10.13.1", + "@polkadot/types-known": "10.13.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "eventemitter3": "^5.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-augment": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-10.13.1.tgz", + "integrity": "sha512-IAKaCp19QxgOG4HKk9RAgUgC/VNVqymZ2GXfMNOZWImZhxRIbrK+raH5vN2MbWwtVHpjxyXvGsd1RRhnohI33A==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api-base": "10.13.1", + "@polkadot/rpc-augment": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/types-augment": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-base": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-10.13.1.tgz", + "integrity": "sha512-Okrw5hjtEjqSMOG08J6qqEwlUQujTVClvY1/eZkzKwNzPelWrtV6vqfyJklB7zVhenlxfxqhZKKcY7zWSW/q5Q==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-core": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-derive": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-10.13.1.tgz", + "integrity": "sha512-ef0H0GeCZ4q5Om+c61eLLLL29UxFC2/u/k8V1K2JOIU+2wD5LF7sjAoV09CBMKKHfkLenRckVk2ukm4rBqFRpg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api": "10.13.1", + "@polkadot/api-augment": "10.13.1", + "@polkadot/api-base": "10.13.1", + "@polkadot/rpc-core": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-12.6.2.tgz", + "integrity": "sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2" + } + }, + "node_modules/@polkadot/networks": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-12.6.2.tgz", + "integrity": "sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "12.6.2", + "@substrate/ss58-registry": "^1.44.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-augment": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-10.13.1.tgz", + "integrity": "sha512-iLsWUW4Jcx3DOdVrSHtN0biwxlHuTs4QN2hjJV0gd0jo7W08SXhWabZIf9mDmvUJIbR7Vk+9amzvegjRyIf5+A==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-core": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-core": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-10.13.1.tgz", + "integrity": "sha512-eoejSHa+/tzHm0vwic62/aptTGbph8vaBpbvLIK7gd00+rT813ROz5ckB1CqQBFB23nHRLuzzX/toY8ID3xrKw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-augment": "10.13.1", + "@polkadot/rpc-provider": "10.13.1", + "@polkadot/types": "10.13.1", + "@polkadot/util": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-provider": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-10.13.1.tgz", + "integrity": "sha512-oJ7tatVXYJ0L7NpNiGd69D558HG5y5ZDmH2Bp9Dd4kFTQIiV8A39SlWwWUPCjSsen9lqSvvprNLnG/VHTpenbw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types": "10.13.1", + "@polkadot/types-support": "10.13.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "@polkadot/x-fetch": "^12.6.2", + "@polkadot/x-global": "^12.6.2", + "@polkadot/x-ws": "^12.6.2", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@substrate/connect": "0.8.8" + } + }, + "node_modules/@polkadot/types": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-10.13.1.tgz", + "integrity": "sha512-Hfvg1ZgJlYyzGSAVrDIpp3vullgxrjOlh/CSThd/PI4TTN1qHoPSFm2hs77k3mKkOzg+LrWsLE0P/LP2XddYcw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types-augment": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/types-create": "10.13.1", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "rxjs": "^7.8.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-augment": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-10.13.1.tgz", + "integrity": "sha512-TcrLhf95FNFin61qmVgOgayzQB/RqVsSg9thAso1Fh6pX4HSbvI35aGPBAn3SkA6R+9/TmtECirpSNLtIGFn0g==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/types": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-codec": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-10.13.1.tgz", + "integrity": "sha512-AiQ2Vv2lbZVxEdRCN8XSERiWlOWa2cTDLnpAId78EnCtx4HLKYQSd+Jk9Y4BgO35R79mchK4iG+w6gZ+ukG2bg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "^12.6.2", + "@polkadot/x-bigint": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-create": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-10.13.1.tgz", + "integrity": "sha512-Usn1jqrz35SXgCDAqSXy7mnD6j4RvB4wyzTAZipFA6DGmhwyxxIgOzlWQWDb+1PtPKo9vtMzen5IJ+7w5chIeA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/types-codec": "10.13.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-known": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-10.13.1.tgz", + "integrity": "sha512-uHjDW05EavOT5JeU8RbiFWTgPilZ+odsCcuEYIJGmK+es3lk/Qsdns9Zb7U7NJl7eJ6OWmRtyrWsLs+bU+jjIQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/networks": "^12.6.2", + "@polkadot/types": "10.13.1", + "@polkadot/types-codec": "10.13.1", + "@polkadot/types-create": "10.13.1", + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-support": { + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-10.13.1.tgz", + "integrity": "sha512-4gEPfz36XRQIY7inKq0HXNVVhR6HvXtm7yrEmuBuhM86LE0lQQBkISUSgR358bdn2OFSLMxMoRNoh3kcDvdGDQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "^12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/util": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", + "@types/bn.js": "^5.1.5", + "bn.js": "^5.2.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/util-crypto": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz", + "integrity": "sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg==", + "license": "Apache-2.0", + "dependencies": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "12.6.2", + "@polkadot/util": "12.6.2", + "@polkadot/wasm-crypto": "^7.3.2", + "@polkadot/wasm-util": "^7.3.2", + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-randomvalues": "12.6.2", + "@scure/base": "^1.1.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2" + } + }, + "node_modules/@polkadot/wasm-bridge": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-bridge/-/wasm-bridge-7.5.2.tgz", + "integrity": "sha512-P9qLGa+PFnBaaPLAYaYfzRV2kgavKJgzYXOIT4ESTeGfPyPQ51DWe4WKQACXHcZLJ2875okC0jHH9bu2ueUsQw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-util": "7.5.2", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-7.5.2.tgz", + "integrity": "sha512-1/J+qu0D1R6Xe5AKZitTGQNmYCmWm+oYFXWx/YG0OjFmEDqMblBwcgh2skwqE83IR87DIwYjHrLt34UMuPx39A==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-bridge": "7.5.2", + "@polkadot/wasm-crypto-asmjs": "7.5.2", + "@polkadot/wasm-crypto-init": "7.5.2", + "@polkadot/wasm-crypto-wasm": "7.5.2", + "@polkadot/wasm-util": "7.5.2", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-asmjs": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.5.2.tgz", + "integrity": "sha512-bb5k2yPuvSu1iyhTyTs9w0X3CUC2tYyqXL9o1Pfi9yiwNtlRFP1RScjSbYMBP7lmibOJ466i1P26w4UYYV/P0g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-init": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.5.2.tgz", + "integrity": "sha512-mT+UVAjwDL8VW0pjAn1TjC3XdkaXm3WZ8vLwCjIeWnrsW33QCVLwGrcaUGWejrTTWAzZmfTGdtIDfaSM5QUSNQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-bridge": "7.5.2", + "@polkadot/wasm-crypto-asmjs": "7.5.2", + "@polkadot/wasm-crypto-wasm": "7.5.2", + "@polkadot/wasm-util": "7.5.2", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-wasm": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.5.2.tgz", + "integrity": "sha512-Tf2HvEJ//HnGalel/FaHfd8wvHYsqY0IYVu5nCeLmbo7HGNR+apEXKIJ7W0kcXg+2U7JhxpT8KspMJg+e3f0kA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-util": "7.5.2", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/wasm-util": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-util/-/wasm-util-7.5.2.tgz", + "integrity": "sha512-DIKy6CMiPsbguU5nUHz/hnD05eZmkT7R/E70cotk+QMaQWT189syJ05Z/YGQD/JdPoRf4uVNA5xHCWLikmzwZQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/x-bigint": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz", + "integrity": "sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-fetch": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz", + "integrity": "sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "node-fetch": "^3.3.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-global": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-12.6.2.tgz", + "integrity": "sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-randomvalues": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz", + "integrity": "sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "12.6.2", + "@polkadot/wasm-util": "*" + } + }, + "node_modules/@polkadot/x-textdecoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-textencoder": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-ws": { + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-12.6.2.tgz", + "integrity": "sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "12.6.2", + "tslib": "^2.6.2", + "ws": "^8.15.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@scure/base": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", + "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@substrate/connect": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/@substrate/connect/-/connect-0.8.8.tgz", + "integrity": "sha512-zwaxuNEVI9bGt0rT8PEJiXOyebLIo6QN1SyiAHRPBOl6g3Sy0KKdSN8Jmyn++oXhVRD8aIe75/V8ZkS81T+BPQ==", + "deprecated": "versions below 1.x are no longer maintained", + "license": "GPL-3.0-only", + "optional": true, + "dependencies": { + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.1", + "@substrate/light-client-extension-helpers": "^0.0.4", + "smoldot": "2.0.22" + } + }, + "node_modules/@substrate/connect-extension-protocol": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.2.2.tgz", + "integrity": "sha512-t66jwrXA0s5Goq82ZtjagLNd7DPGCNjHeehRlE/gcJmJ+G56C0W+2plqOMRicJ8XGR1/YFnUSEqUFiSNbjGrAA==", + "license": "GPL-3.0-only", + "optional": true + }, + "node_modules/@substrate/connect-known-chains": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.10.3.tgz", + "integrity": "sha512-OJEZO1Pagtb6bNE3wCikc2wrmvEU5x7GxFFLqqbz1AJYYxSlrPCGu4N2og5YTExo4IcloNMQYFRkBGue0BKZ4w==", + "license": "GPL-3.0-only", + "optional": true + }, + "node_modules/@substrate/light-client-extension-helpers": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.4.tgz", + "integrity": "sha512-vfKcigzL0SpiK+u9sX6dq2lQSDtuFLOxIJx2CKPouPEHIs8C+fpsufn52r19GQn+qDhU8POMPHOVoqLktj8UEA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/client": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/json-rpc-provider": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/json-rpc-provider-proxy": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@polkadot-api/substrate-client": "0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0", + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.1", + "rxjs": "^7.8.1" + }, + "peerDependencies": { + "smoldot": "2.x" + } + }, + "node_modules/@substrate/ss58-registry": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/@substrate/ss58-registry/-/ss58-registry-1.51.0.tgz", + "integrity": "sha512-TWDurLiPxndFgKjVavCniytBIw+t4ViOi7TYp9h/D0NMmkEc9klFTo+827eyEJ0lELpqO207Ey7uGxUa+BS1jQ==", + "license": "Apache-2.0" + }, + "node_modules/@types/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bn.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mock-socket": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.3.1.tgz", + "integrity": "sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nock": { + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.6.tgz", + "integrity": "sha512-o2zOYiCpzRqSzPj0Zt/dQ/DqZeYoaQ7TUonc/xUPjCGl9WeHpNbxgVvOquXYAaJzI0M9BXV3HTzG0p8IUAbBTQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + }, + "engines": { + "node": ">= 10.13" + } + }, + "node_modules/nock/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nock/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/nodemon": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.11.tgz", + "integrity": "sha512-is96t8F/1//UHAjNPHpbsNY46ELPpftGUoSVNXwUfMk/qdjSylYrWSu1XavVTBOn526kFiOR733ATgNBCQyH0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scale-ts": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.1.tgz", + "integrity": "sha512-PBMc2AWc6wSEqJYBDPcyCLUj9/tMKnLX70jLOSndMtcUoLQucP/DM0vnQo1wJAYjTrQiq8iG9rD0q6wFzgjH7g==", + "license": "MIT", + "optional": true + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/smoldot": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/smoldot/-/smoldot-2.0.22.tgz", + "integrity": "sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g==", + "license": "GPL-3.0-or-later WITH Classpath-exception-2.0", + "optional": true, + "dependencies": { + "ws": "^8.8.1" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 00000000..d8b55684 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,22 @@ +{ + "name": "pezkuwi-kyc-backend", + "version": "1.0.0", + "description": "KYC Approval Council Backend", + "main": "src/server.js", + "type": "module", + "scripts": { + "dev": "node --watch src/server.js", + "start": "node src/server.js" + }, + "dependencies": { + "express": "^4.18.2", + "cors": "^2.8.5", + "dotenv": "^16.3.1", + "@polkadot/api": "^10.11.1", + "@polkadot/keyring": "^12.5.1", + "@polkadot/util-crypto": "^12.5.1" + }, + "devDependencies": { + "nodemon": "^3.0.2" + } +} diff --git a/backend/src/server.js b/backend/src/server.js new file mode 100644 index 00000000..91bbe195 --- /dev/null +++ b/backend/src/server.js @@ -0,0 +1,372 @@ +import express from 'express'; +import cors from 'cors'; +import dotenv from 'dotenv'; +import { ApiPromise, WsProvider, Keyring } from '@polkadot/api'; +import { cryptoWaitReady } from '@polkadot/util-crypto'; + +dotenv.config(); + +const app = express(); +app.use(cors()); +app.use(express.json()); + +// ======================================== +// KYC COUNCIL STATE +// ======================================== + +// Council members (wallet addresses) +const councilMembers = new Set([ + '5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3' // Initial: Founder's delegate +]); + +// Pending KYC votes: Map +const kycVotes = new Map(); + +// Threshold: 60% +const THRESHOLD_PERCENT = 0.6; + +// Sudo account for signing approve_kyc +let sudoAccount = null; +let api = null; + +// ======================================== +// BLOCKCHAIN CONNECTION +// ======================================== + +async function initBlockchain() { + console.log('🔗 Connecting to PezkuwiChain...'); + + const wsProvider = new WsProvider(process.env.WS_ENDPOINT || 'wss://ws.pezkuwichain.io'); + api = await ApiPromise.create({ provider: wsProvider }); + + await cryptoWaitReady(); + + // Initialize sudo account from env + if (process.env.SUDO_SEED) { + const keyring = new Keyring({ type: 'sr25519' }); + sudoAccount = keyring.addFromUri(process.env.SUDO_SEED); + console.log('✅ Sudo account loaded:', sudoAccount.address); + } else { + console.warn('⚠️ No SUDO_SEED in .env - auto-approval disabled'); + } + + console.log('✅ Connected to blockchain'); + console.log('📊 Chain:', await api.rpc.system.chain()); + console.log('🏛️ Runtime version:', api.runtimeVersion.specVersion.toNumber()); +} + +// ======================================== +// COUNCIL MANAGEMENT +// ======================================== + +// Add member to council (only founder/sudo can call) +app.post('/api/council/add-member', async (req, res) => { + const { address, signature } = req.body; + + // TODO: Verify signature from founder + // For now, just add + + if (!address || address.length < 47) { + return res.status(400).json({ error: 'Invalid address' }); + } + + councilMembers.add(address); + + console.log(`✅ Council member added: ${address}`); + console.log(`📊 Total members: ${councilMembers.size}`); + + res.json({ + success: true, + totalMembers: councilMembers.size, + members: Array.from(councilMembers) + }); +}); + +// Remove member from council +app.post('/api/council/remove-member', async (req, res) => { + const { address } = req.body; + + if (!councilMembers.has(address)) { + return res.status(404).json({ error: 'Member not found' }); + } + + councilMembers.delete(address); + + console.log(`❌ Council member removed: ${address}`); + console.log(`📊 Total members: ${councilMembers.size}`); + + res.json({ + success: true, + totalMembers: councilMembers.size, + members: Array.from(councilMembers) + }); +}); + +// Get council members +app.get('/api/council/members', (req, res) => { + res.json({ + members: Array.from(councilMembers), + totalMembers: councilMembers.size, + threshold: THRESHOLD_PERCENT, + votesRequired: Math.ceil(councilMembers.size * THRESHOLD_PERCENT) + }); +}); + +// ======================================== +// KYC VOTING +// ======================================== + +// Propose KYC approval +app.post('/api/kyc/propose', async (req, res) => { + const { userAddress, proposerAddress, signature } = req.body; + + // Verify proposer is council member + if (!councilMembers.has(proposerAddress)) { + return res.status(403).json({ error: 'Not a council member' }); + } + + // TODO: Verify signature + + // Check if already has votes + if (kycVotes.has(userAddress)) { + return res.status(400).json({ error: 'Proposal already exists' }); + } + + // Create vote record + kycVotes.set(userAddress, { + ayes: new Set([proposerAddress]), // Proposer auto-votes aye + nays: new Set(), + proposer: proposerAddress, + timestamp: Date.now() + }); + + console.log(`📝 KYC proposal created for ${userAddress} by ${proposerAddress}`); + + // Check if threshold already met (e.g., only 1 member) + await checkAndExecute(userAddress); + + res.json({ + success: true, + userAddress, + votesCount: 1, + threshold: Math.ceil(councilMembers.size * THRESHOLD_PERCENT) + }); +}); + +// Vote on KYC proposal +app.post('/api/kyc/vote', async (req, res) => { + const { userAddress, voterAddress, approve, signature } = req.body; + + // Verify voter is council member + if (!councilMembers.has(voterAddress)) { + return res.status(403).json({ error: 'Not a council member' }); + } + + // Check if proposal exists + if (!kycVotes.has(userAddress)) { + return res.status(404).json({ error: 'Proposal not found' }); + } + + // TODO: Verify signature + + const votes = kycVotes.get(userAddress); + + // Add vote + if (approve) { + votes.nays.delete(voterAddress); // Remove from nays if exists + votes.ayes.add(voterAddress); + console.log(`✅ AYE vote from ${voterAddress} for ${userAddress}`); + } else { + votes.ayes.delete(voterAddress); // Remove from ayes if exists + votes.nays.add(voterAddress); + console.log(`❌ NAY vote from ${voterAddress} for ${userAddress}`); + } + + // Check if threshold reached + await checkAndExecute(userAddress); + + res.json({ + success: true, + ayes: votes.ayes.size, + nays: votes.nays.size, + threshold: Math.ceil(councilMembers.size * THRESHOLD_PERCENT), + status: votes.ayes.size >= Math.ceil(councilMembers.size * THRESHOLD_PERCENT) ? 'APPROVED' : 'VOTING' + }); +}); + +// Check if threshold reached and execute approve_kyc +async function checkAndExecute(userAddress) { + const votes = kycVotes.get(userAddress); + if (!votes) return; + + const requiredVotes = Math.ceil(councilMembers.size * THRESHOLD_PERCENT); + const currentAyes = votes.ayes.size; + + console.log(`📊 Votes: ${currentAyes}/${requiredVotes} (${councilMembers.size} members, ${THRESHOLD_PERCENT * 100}% threshold)`); + + if (currentAyes >= requiredVotes) { + console.log(`🎉 Threshold reached for ${userAddress}! Executing approve_kyc...`); + + if (!sudoAccount || !api) { + console.error('❌ Cannot execute: No sudo account or API connection'); + return; + } + + try { + // Submit approve_kyc transaction + const tx = api.tx.identityKyc.approveKyc(userAddress); + + await new Promise((resolve, reject) => { + tx.signAndSend(sudoAccount, ({ status, dispatchError, events }) => { + console.log(`📡 Transaction status: ${status.type}`); + + if (status.isInBlock || status.isFinalized) { + if (dispatchError) { + let errorMessage = 'Transaction failed'; + + if (dispatchError.isModule) { + const decoded = api.registry.findMetaError(dispatchError.asModule); + errorMessage = `${decoded.section}.${decoded.name}: ${decoded.docs.join(' ')}`; + } else { + errorMessage = dispatchError.toString(); + } + + console.error(`❌ Approval failed: ${errorMessage}`); + reject(new Error(errorMessage)); + return; + } + + // Check for KycApproved event + const approvedEvent = events.find(({ event }) => + event.section === 'identityKyc' && event.method === 'KycApproved' + ); + + if (approvedEvent) { + console.log(`✅ KYC APPROVED for ${userAddress}`); + console.log(`🏛️ User will receive Welati NFT automatically`); + + // Remove from pending votes + kycVotes.delete(userAddress); + + resolve(); + } else { + console.warn('⚠️ Transaction included but no KycApproved event'); + resolve(); + } + } + }).catch(reject); + }); + + } catch (error) { + console.error(`❌ Error executing approve_kyc:`, error); + } + } +} + +// Get pending KYC votes +app.get('/api/kyc/pending', (req, res) => { + const pending = []; + + for (const [userAddress, votes] of kycVotes.entries()) { + pending.push({ + userAddress, + proposer: votes.proposer, + ayes: Array.from(votes.ayes), + nays: Array.from(votes.nays), + timestamp: votes.timestamp, + votesCount: votes.ayes.size, + threshold: Math.ceil(councilMembers.size * THRESHOLD_PERCENT), + status: votes.ayes.size >= Math.ceil(councilMembers.size * THRESHOLD_PERCENT) ? 'APPROVED' : 'VOTING' + }); + } + + res.json({ pending }); +}); + +// ======================================== +// AUTO-UPDATE COUNCIL FROM BLOCKCHAIN +// ======================================== + +// Sync council with Noter tiki holders +app.post('/api/council/sync-notaries', async (req, res) => { + if (!api) { + return res.status(503).json({ error: 'Blockchain not connected' }); + } + + console.log('🔄 Syncing council with Noter tiki holders...'); + + try { + // Get all users with tikis + const entries = await api.query.tiki.userTikis.entries(); + + const notaries = []; + const NOTER_INDEX = 9; // Noter tiki index + + for (const [key, tikis] of entries) { + const address = key.args[0].toString(); + const tikiList = tikis.toJSON(); + + // Check if user has Noter tiki + if (tikiList && tikiList.includes(NOTER_INDEX)) { + notaries.push(address); + } + } + + console.log(`📊 Found ${notaries.length} Noter tiki holders`); + + // Add first 10 notaries to council + const founderDelegate = '5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3'; + councilMembers.clear(); + councilMembers.add(founderDelegate); + + notaries.slice(0, 10).forEach(address => { + councilMembers.add(address); + }); + + console.log(`✅ Council updated: ${councilMembers.size} members`); + + res.json({ + success: true, + totalMembers: councilMembers.size, + members: Array.from(councilMembers), + notariesFound: notaries.length + }); + + } catch (error) { + console.error('❌ Error syncing notaries:', error); + res.status(500).json({ error: error.message }); + } +}); + +// ======================================== +// HEALTH CHECK +// ======================================== + +app.get('/health', (req, res) => { + res.json({ + status: 'ok', + blockchain: api ? 'connected' : 'disconnected', + sudoAccount: sudoAccount ? sudoAccount.address : 'not configured', + councilMembers: councilMembers.size, + pendingVotes: kycVotes.size + }); +}); + +// ======================================== +// START SERVER +// ======================================== + +const PORT = process.env.PORT || 3001; + +initBlockchain() + .then(() => { + app.listen(PORT, () => { + console.log(`🚀 KYC Council Backend running on port ${PORT}`); + console.log(`📊 Council members: ${councilMembers.size}`); + console.log(`🎯 Threshold: ${THRESHOLD_PERCENT * 100}%`); + }); + }) + .catch(error => { + console.error('❌ Failed to initialize blockchain:', error); + process.exit(1); + }); diff --git a/scripts/create_collection_42.js b/scripts/create_collection_42.js new file mode 100755 index 00000000..ce2d4b96 --- /dev/null +++ b/scripts/create_collection_42.js @@ -0,0 +1,129 @@ +#!/usr/bin/env node +/** + * Creates NFT Collection #42 for Tiki citizenship system + * + * IMPORTANT: This script ensures Collection 42 exists before citizenship NFTs can be minted. + * Must be run after chain initialization and before any citizenship operations. + * + * Usage: + * node scripts/create_collection_42.js [ws://127.0.0.1:9944] + */ + +const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); + +async function createCollection42() { + // Get WebSocket endpoint from args or use default + const wsEndpoint = process.argv[2] || 'ws://127.0.0.1:9944'; + + const wsProvider = new WsProvider(wsEndpoint); + const api = await ApiPromise.create({ provider: wsProvider }); + + const keyring = new Keyring({ type: 'sr25519' }); + const alice = keyring.addFromUri('//Alice'); + + console.log(`🔗 Connected to ${wsEndpoint}\n`); + console.log('🎯 Target: Create NFT Collection #42 for Tiki citizenship system\n'); + + // Check current NextCollectionId + const nextCollectionId = await api.query.nfts.nextCollectionId(); + const currentId = nextCollectionId.isNone ? 0 : nextCollectionId.unwrap().toNumber(); + + console.log(`📊 Current NextCollectionId: ${currentId}`); + + if (currentId > 42) { + console.log('❌ ERROR: NextCollectionId is already past 42!'); + console.log(' Collection 42 cannot be created anymore.'); + console.log(' You need to start with a fresh chain.'); + process.exit(1); + } + + if (currentId === 42) { + console.log('✅ NextCollectionId is exactly 42! Creating Collection 42 now...\n'); + await createSingleCollection(api, alice, 42); + await api.disconnect(); + process.exit(0); + } + + // Need to create multiple collections to reach 42 + const collectionsToCreate = 42 - currentId + 1; + console.log(`📝 Need to create ${collectionsToCreate} collections (IDs ${currentId} through 42)\n`); + + // Create collections in batches to reach 42 + for (let i = currentId; i <= 42; i++) { + await createSingleCollection(api, alice, i); + } + + console.log('\n🎉 Success! Collection 42 has been created and is ready for Tiki citizenship NFTs.'); + console.log(' You can now use the self-confirmation citizenship system.'); + + await api.disconnect(); +} + +async function createSingleCollection(api, signer, expectedId) { + return new Promise((resolve, reject) => { + const config = api.createType('PalletNftsCollectionConfig', { + settings: 0, + maxSupply: null, + mintSettings: { + mintType: { Issuer: null }, + price: null, + startBlock: null, + endBlock: null, + defaultItemSettings: 0 + } + }); + + const tx = api.tx.sudo.sudo( + api.tx.nfts.forceCreate( + { Id: signer.address }, + config + ) + ); + + console.log(` Creating Collection #${expectedId}...`); + + tx.signAndSend(signer, ({ status, events, dispatchError }) => { + if (status.isInBlock || status.isFinalized) { + if (dispatchError) { + let errorMessage = 'Transaction failed'; + if (dispatchError.isModule) { + const decoded = api.registry.findMetaError(dispatchError.asModule); + errorMessage = `${decoded.section}.${decoded.name}: ${decoded.docs.join(' ')}`; + } else { + errorMessage = dispatchError.toString(); + } + console.log(` ❌ Error: ${errorMessage}`); + reject(new Error(errorMessage)); + return; + } + + let createdCollectionId = null; + events.forEach(({ event }) => { + if (event.section === 'nfts' && event.method === 'ForceCreated') { + createdCollectionId = event.data[0].toNumber(); + } + }); + + if (createdCollectionId !== null) { + if (createdCollectionId === expectedId) { + if (expectedId === 42) { + console.log(` ✅ Collection #${createdCollectionId} created! 🎯 THIS IS THE TIKI COLLECTION!`); + } else { + console.log(` ✓ Collection #${createdCollectionId} created (placeholder)`); + } + } else { + console.log(` ⚠️ Warning: Expected #${expectedId} but got #${createdCollectionId}`); + } + } + + resolve(createdCollectionId); + } + }).catch(reject); + }); +} + +// Handle errors +createCollection42().catch(error => { + console.error('\n❌ Fatal error:', error.message); + process.exit(1); +}); diff --git a/shared/images/B2BplatformLogo.png b/shared/images/B2BplatformLogo.png new file mode 100644 index 00000000..407d1fc9 Binary files /dev/null and b/shared/images/B2BplatformLogo.png differ diff --git a/shared/images/BankLogo.png b/shared/images/BankLogo.png new file mode 100644 index 00000000..049bb8db Binary files /dev/null and b/shared/images/BankLogo.png differ diff --git a/shared/images/DKstate.png b/shared/images/DKstate.png new file mode 100644 index 00000000..3879798a Binary files /dev/null and b/shared/images/DKstate.png differ diff --git a/shared/images/GovernmentEntrance.png b/shared/images/GovernmentEntrance.png new file mode 100644 index 00000000..8be79c20 Binary files /dev/null and b/shared/images/GovernmentEntrance.png differ diff --git a/shared/images/PezkuwiExchange.png b/shared/images/PezkuwiExchange.png new file mode 100644 index 00000000..786216ed Binary files /dev/null and b/shared/images/PezkuwiExchange.png differ diff --git a/shared/images/Universuitylogo.png b/shared/images/Universuitylogo.png new file mode 100644 index 00000000..adb3ffb8 Binary files /dev/null and b/shared/images/Universuitylogo.png differ diff --git a/shared/images/adaptive-icon.png b/shared/images/adaptive-icon.png new file mode 100644 index 00000000..fa697152 Binary files /dev/null and b/shared/images/adaptive-icon.png differ diff --git a/shared/images/app-image.png b/shared/images/app-image.png new file mode 100644 index 00000000..5a8a4fa6 Binary files /dev/null and b/shared/images/app-image.png differ diff --git a/shared/images/digital_citizen_card.png b/shared/images/digital_citizen_card.png new file mode 100644 index 00000000..b94c5049 Binary files /dev/null and b/shared/images/digital_citizen_card.png differ diff --git a/shared/images/divankurulu.jpg b/shared/images/divankurulu.jpg new file mode 100644 index 00000000..aa67c269 Binary files /dev/null and b/shared/images/divankurulu.jpg differ diff --git a/shared/images/favicon.png b/shared/images/favicon.png new file mode 100644 index 00000000..fa697152 Binary files /dev/null and b/shared/images/favicon.png differ diff --git a/shared/images/favicon2.ico b/shared/images/favicon2.ico new file mode 100644 index 00000000..f1f6bf58 Binary files /dev/null and b/shared/images/favicon2.ico differ diff --git a/shared/images/governance.png b/shared/images/governance.png new file mode 100644 index 00000000..b763fe72 Binary files /dev/null and b/shared/images/governance.png differ diff --git a/shared/images/hez_logo_kurdistangunesi.png b/shared/images/hez_logo_kurdistangunesi.png new file mode 100644 index 00000000..0e2befbb Binary files /dev/null and b/shared/images/hez_logo_kurdistangunesi.png differ diff --git a/shared/images/icon.png b/shared/images/icon.png new file mode 100644 index 00000000..d7aa29b5 Binary files /dev/null and b/shared/images/icon.png differ diff --git a/shared/images/kurdistan_sun_light.png b/shared/images/kurdistan_sun_light.png new file mode 100644 index 00000000..c22767da Binary files /dev/null and b/shared/images/kurdistan_sun_light.png differ diff --git a/shared/images/kurdmedia.jpg b/shared/images/kurdmedia.jpg new file mode 100644 index 00000000..747a097d Binary files /dev/null and b/shared/images/kurdmedia.jpg differ diff --git a/shared/images/lotteryLogo.png b/shared/images/lotteryLogo.png new file mode 100644 index 00000000..062cf197 Binary files /dev/null and b/shared/images/lotteryLogo.png differ diff --git a/shared/images/nishtiman.jpeg b/shared/images/nishtiman.jpeg new file mode 100644 index 00000000..838117cb Binary files /dev/null and b/shared/images/nishtiman.jpeg differ diff --git a/shared/images/partial-react-logo.png b/shared/images/partial-react-logo.png new file mode 100644 index 00000000..66fd9570 Binary files /dev/null and b/shared/images/partial-react-logo.png differ diff --git a/shared/images/pezkuwichain_logo.png b/shared/images/pezkuwichain_logo.png new file mode 100644 index 00000000..7d78edc0 Binary files /dev/null and b/shared/images/pezkuwichain_logo.png differ diff --git a/shared/images/pezkuwiportal2.jpg b/shared/images/pezkuwiportal2.jpg new file mode 100644 index 00000000..d48929ea Binary files /dev/null and b/shared/images/pezkuwiportal2.jpg differ diff --git a/shared/images/quick-actions/qa_b2b.png b/shared/images/quick-actions/qa_b2b.png new file mode 100644 index 00000000..e3ca7ac9 Binary files /dev/null and b/shared/images/quick-actions/qa_b2b.png differ diff --git a/shared/images/quick-actions/qa_bank.png b/shared/images/quick-actions/qa_bank.png new file mode 100644 index 00000000..9c6e049d Binary files /dev/null and b/shared/images/quick-actions/qa_bank.png differ diff --git a/shared/images/quick-actions/qa_dashboard.png b/shared/images/quick-actions/qa_dashboard.png new file mode 100644 index 00000000..2e65f60a Binary files /dev/null and b/shared/images/quick-actions/qa_dashboard.png differ diff --git a/shared/images/quick-actions/qa_education.png b/shared/images/quick-actions/qa_education.png new file mode 100644 index 00000000..b2f70638 Binary files /dev/null and b/shared/images/quick-actions/qa_education.png differ diff --git a/shared/images/quick-actions/qa_exchange.png b/shared/images/quick-actions/qa_exchange.png new file mode 100644 index 00000000..d69ac483 Binary files /dev/null and b/shared/images/quick-actions/qa_exchange.png differ diff --git a/shared/images/quick-actions/qa_forum.jpg b/shared/images/quick-actions/qa_forum.jpg new file mode 100644 index 00000000..b69fdf0c Binary files /dev/null and b/shared/images/quick-actions/qa_forum.jpg differ diff --git a/shared/images/quick-actions/qa_games.png b/shared/images/quick-actions/qa_games.png new file mode 100644 index 00000000..062cf197 Binary files /dev/null and b/shared/images/quick-actions/qa_games.png differ diff --git a/shared/images/quick-actions/qa_governance.jpg b/shared/images/quick-actions/qa_governance.jpg new file mode 100644 index 00000000..b6e8f9ab Binary files /dev/null and b/shared/images/quick-actions/qa_governance.jpg differ diff --git a/shared/images/quick-actions/qa_home.jpg b/shared/images/quick-actions/qa_home.jpg new file mode 100644 index 00000000..f2a77b6d Binary files /dev/null and b/shared/images/quick-actions/qa_home.jpg differ diff --git a/shared/images/quick-actions/qa_kurdmedia.jpg b/shared/images/quick-actions/qa_kurdmedia.jpg new file mode 100644 index 00000000..747a097d Binary files /dev/null and b/shared/images/quick-actions/qa_kurdmedia.jpg differ diff --git a/shared/images/quick-actions/qa_qazwancafe.jpg b/shared/images/quick-actions/qa_qazwancafe.jpg new file mode 100644 index 00000000..a7d819d7 Binary files /dev/null and b/shared/images/quick-actions/qa_qazwancafe.jpg differ diff --git a/shared/images/quick-actions/qa_rewards.png b/shared/images/quick-actions/qa_rewards.png new file mode 100644 index 00000000..b735f3b9 Binary files /dev/null and b/shared/images/quick-actions/qa_rewards.png differ diff --git a/shared/images/quick-actions/qa_trading.jpg b/shared/images/quick-actions/qa_trading.jpg new file mode 100644 index 00000000..fcfcb569 Binary files /dev/null and b/shared/images/quick-actions/qa_trading.jpg differ diff --git a/shared/images/quick-actions/qa_university.png b/shared/images/quick-actions/qa_university.png new file mode 100644 index 00000000..adb3ffb8 Binary files /dev/null and b/shared/images/quick-actions/qa_university.png differ diff --git a/shared/images/react-logo.png b/shared/images/react-logo.png new file mode 100644 index 00000000..9d72a9ff Binary files /dev/null and b/shared/images/react-logo.png differ diff --git a/shared/images/react-logo@2x.png b/shared/images/react-logo@2x.png new file mode 100644 index 00000000..2229b130 Binary files /dev/null and b/shared/images/react-logo@2x.png differ diff --git a/shared/images/react-logo@3x.png b/shared/images/react-logo@3x.png new file mode 100644 index 00000000..a99b2032 Binary files /dev/null and b/shared/images/react-logo@3x.png differ diff --git a/shared/images/splash-image.png b/shared/images/splash-image.png new file mode 100644 index 00000000..e727ffc0 Binary files /dev/null and b/shared/images/splash-image.png differ diff --git a/shared/images/vicdanlogo.jpg b/shared/images/vicdanlogo.jpg new file mode 100644 index 00000000..b6e8f9ab Binary files /dev/null and b/shared/images/vicdanlogo.jpg differ diff --git a/web/src/components/ui/badge.test.tsx b/web/src/components/ui/badge.test.tsx new file mode 100644 index 00000000..eb4fb104 --- /dev/null +++ b/web/src/components/ui/badge.test.tsx @@ -0,0 +1,13 @@ +import { render, screen } from '@testing-library/react'; +import { describe, it, expect } from 'vitest'; +import { Badge } from './badge'; + +describe('Badge Component', () => { + it('should render the badge with the correct text', () => { + const testMessage = 'Hello, World!'; + render({testMessage}); + + const badgeElement = screen.getByText(testMessage); + expect(badgeElement).toBeInTheDocument(); + }); +}); diff --git a/web/src/config/commissions.ts b/web/src/config/commissions.ts new file mode 100644 index 00000000..15c3e27f --- /dev/null +++ b/web/src/config/commissions.ts @@ -0,0 +1,19 @@ +// Commission Configuration + +export const COMMISSIONS = { + KYC: { + name: 'KYC Approval Commission', + proxyAccount: '5Hdybwv6Kbd3DJGY8DzfY4rKJWWFDPbLbuKQ81fk6eJATcTj', // KYC Commission proxy account + threshold: 7, // 60% of 11 members + totalMembers: 11, + }, + // Future commissions + VAKIF: { + name: 'Vakıf Commission', + proxyAccount: '', // TBD + threshold: 5, + totalMembers: 7, + }, +} as const; + +export type CommissionType = keyof typeof COMMISSIONS; diff --git a/web/src/pages/GovEntrance.tsx b/web/src/pages/GovEntrance.tsx new file mode 100644 index 00000000..724a86f6 --- /dev/null +++ b/web/src/pages/GovEntrance.tsx @@ -0,0 +1,392 @@ +import { useEffect, useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; +import { Button } from '@/components/ui/button'; +import { Badge } from '@/components/ui/badge'; +import { usePolkadot } from '@/contexts/PolkadotContext'; +import { useDashboard } from '@/contexts/DashboardContext'; +import { + ArrowLeft, + Vote, + Users, + FileText, + Scale, + Megaphone, + CheckCircle, + XCircle, + Clock, + TrendingUp, + AlertCircle, + Home +} from 'lucide-react'; +import { useToast } from '@/hooks/use-toast'; + +export default function GovEntrance() { + const { api, isApiReady, selectedAccount } = usePolkadot(); + const { nftDetails, kycStatus, loading: dashboardLoading } = useDashboard(); + const navigate = useNavigate(); + const { toast } = useToast(); + const [loading, setLoading] = useState(true); + + useEffect(() => { + checkGovernmentRole(); + }, [nftDetails, dashboardLoading]); + + const checkGovernmentRole = () => { + if (dashboardLoading) { + setLoading(true); + return; + } + + // Check if user has government role NFT + const hasGovernmentRole = nftDetails.roleNFTs.some(nft => { + // Check if NFT is a government role (collection 42, items 10-99 are government roles) + return nft.collectionId === 42 && nft.itemId >= 10 && nft.itemId < 100; + }); + + if (!hasGovernmentRole) { + toast({ + title: "Mafê Te Tuneye (No Access)", + description: "Divê hûn xwedîyê Rola Hikûmetê bin ku vê rûpelê bigihînin (You must have a Government Role to access this page)", + variant: "destructive" + }); + navigate('/citizens'); + return; + } + + setLoading(false); + }; + + const handleFeatureClick = (feature: string) => { + toast({ + title: "Çalakiyê di bin nîgehdariyek de ye (Under Development)", + description: `${feature} nûve tê avakirin (${feature} is currently under development)`, + }); + }; + + if (loading) { + return ( +
+ + +
+
+

Deriyê Hikûmetê tê barkirin... (Loading Government Portal...)

+
+
+
+
+ ); + } + + // Show government portal + return ( +
+
+ {/* Back Button */} +
+ +
+ + {/* Hero Section */} +
+

+ 🏛️ Deriyê Hikûmetê (Government Entrance) +

+

+ Beşdariya Demokratîk (Democratic Participation) +

+

+ Mafên xwe yên demokratîk bi kar bînin û di rêveberiya welêt de beşdar bibin +

+

+ (Exercise your democratic rights and participate in governance) +

+
+ + {/* Main Features Grid */} +
+ {/* 1. Elections - Hilbijartinên (Elections) */} + handleFeatureClick('Hilbijartinên (Elections)')} + > + +
+
+ +
+ + Aktîf (Active) + +
+ Hilbijartinên + (Elections & Voting) +
+ +
    +
  • + + Hilbijartina Serok (Presidential Election) +
  • +
  • + + Hilbijartina Parlamentoyê (Parliamentary Elections) +
  • +
  • + + Hilbijartina Serokê Meclisê (Speaker Election) +
  • +
  • + + Dadgeha Destûrî (Constitutional Court) +
  • +
+
+
+ + {/* 2. Candidacy - Berjewendî (Candidacy) */} + handleFeatureClick('Berjewendî (Candidacy)')} + > + +
+
+ +
+ + Mafên Te (Your Rights) + +
+ Berjewendî + (Run for Office) +
+ +
    +
  • + + Bibe Berjewendiyê Serokbûnê (Presidential Candidate) +
  • +
  • + + Bibe Parlementêr (Parliamentary Candidate) +
  • +
  • + + Pêdiviya Trust Score: 300-750 +
  • +
  • + + Piştgiriya pêwîst: 100-1000 endorsements +
  • +
+
+
+ + {/* 3. Proposals - Pêşniyar (Legislative Proposals) */} + handleFeatureClick('Pêşniyar (Proposals)')} + > + +
+
+ +
+ + Yasayan (Legislative) + +
+ Pêşniyar + (Submit Proposals) +
+ +
    +
  • + + Pêşniyarên Yasayê (Legislative Proposals) +
  • +
  • + + Guheztinên Destûrî (Constitutional Amendments) +
  • +
  • + + Pêşniyarên Budçeyê (Budget Proposals) +
  • +
+
+
+ + {/* 4. Voting on Proposals - Dengdayîn (Vote on Proposals) */} + handleFeatureClick('Dengdayîn (Voting)')} + > + +
+
+ +
+ + Parlamenter (MPs Only) + +
+ Dengdayîn + (Parliamentary Voting) +
+ +
    +
  • + + Erê (Aye) +
  • +
  • + + Na (Nay) +
  • +
  • + + Bêalî (Abstain) +
  • +
  • + + Majority types: Simple (50%+1), Super (2/3), Absolute (3/4) +
  • +
+
+
+ + {/* 5. Veto & Override - Veto û Têperbûn (Veto System) */} + handleFeatureClick('Veto û Têperbûn (Veto System)')} + > + +
+
+ +
+ + Serok (President) + +
+ Veto û Têperbûn + (Veto & Override) +
+ +
    +
  • + + Vetoya Serok (Presidential Veto) +
  • +
  • + + Têperbûna Parlamentoyê (Parliamentary Override - 2/3) +
  • +
  • + + Pêdiviya 134 deng ji 201 (Requires 134 of 201 votes) +
  • +
+
+
+ + {/* 6. Government Appointments - Tayinên Hikûmetê (Official Appointments) */} + handleFeatureClick('Tayinên Hikûmetê (Appointments)')} + > + +
+
+ +
+ + Wezîr (Ministers) + +
+ Tayinên Hikûmetê + (Government Officials) +
+ +
    +
  • + + Wezîrên Kabîneyê (Cabinet Ministers) +
  • +
  • + + Dadger, Xezinedar, Noter (Judges, Treasury, Notary) +
  • +
  • + + Piştgiriya Serok pêwîst e (Presidential approval required) +
  • +
+
+
+
+ + {/* Status Overview */} + + + + + Statûya Te ya Welatîbûnê (Your Citizenship Status) + + + +
+
+

KYC Status

+
+ + + {kycStatus} + +
+
+
+

Mafên Dengdayînê (Voting Rights)

+
+ + + Aktîf (Active) + +
+
+
+

Beşdariya Rêveberiyê (Participation)

+
+ + + Amade (Ready) + +
+
+
+
+

+ Bala xwe bidin (Important): Hemû mafên welatîbûnê yên te çalak in. + Tu dikarî di hemû hilbijartinên demokratîk de beşdar bibî û deng bidî. +
+ + (All your citizenship rights are active. You can participate and vote in all democratic elections.) + +

+
+
+
+
+
+ ); +} diff --git a/web/src/tests/setup.ts b/web/src/tests/setup.ts new file mode 100644 index 00000000..7b0828bf --- /dev/null +++ b/web/src/tests/setup.ts @@ -0,0 +1 @@ +import '@testing-library/jest-dom';